datamule 2.0.0__py3-none-any.whl → 2.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datamule/datamule/downloader.py +3 -3
- datamule/sheet.py +21 -1
- {datamule-2.0.0.dist-info → datamule-2.0.2.dist-info}/METADATA +1 -1
- {datamule-2.0.0.dist-info → datamule-2.0.2.dist-info}/RECORD +6 -6
- {datamule-2.0.0.dist-info → datamule-2.0.2.dist-info}/WHEEL +0 -0
- {datamule-2.0.0.dist-info → datamule-2.0.2.dist-info}/top_level.txt +0 -0
datamule/datamule/downloader.py
CHANGED
@@ -311,11 +311,11 @@ class Downloader:
|
|
311
311
|
columns=['accessionNumber'], distinct=True, page_size=25000, quiet=False,api_key=self.api_key)
|
312
312
|
|
313
313
|
if filtered_accession_numbers:
|
314
|
-
filtered_accession_numbers = [
|
314
|
+
filtered_accession_numbers = [format_accession(item,'int') for item in filtered_accession_numbers]
|
315
315
|
filings = [filing for filing in filings if filing['accessionNumber'] in filtered_accession_numbers]
|
316
316
|
|
317
317
|
if skip_accession_numbers:
|
318
|
-
skip_accession_numbers = [
|
318
|
+
skip_accession_numbers = [format(item,'int') for item in skip_accession_numbers]
|
319
319
|
filings = [filing for filing in filings if filing['accessionNumber'] not in skip_accession_numbers]
|
320
320
|
|
321
321
|
logger.debug(f"Generating URLs for {len(filings)} filings...")
|
@@ -394,7 +394,7 @@ def download(submission_type=None, cik=None, filing_date=None, api_key=None, out
|
|
394
394
|
skip_accession_numbers=[], max_batch_size=1024*1024*1024,accession_numbers=None):
|
395
395
|
|
396
396
|
if filtered_accession_numbers:
|
397
|
-
filtered_accession_numbers = [
|
397
|
+
filtered_accession_numbers = [format_accession(x,'int') for x in filtered_accession_numbers]
|
398
398
|
elif filtered_accession_numbers == []:
|
399
399
|
raise ValueError("Applied filter resulted in empty accession numbers list")
|
400
400
|
downloader = Downloader(api_key=api_key)
|
datamule/sheet.py
CHANGED
@@ -5,6 +5,8 @@ from .helper import _process_cik_and_metadata_filters, load_package_dataset
|
|
5
5
|
from .sec.xbrl.downloadcompanyfacts import download_company_facts
|
6
6
|
from .datamule.datamule_lookup import datamule_lookup
|
7
7
|
from .datamule.datamule_mysql_rds import query_mysql_rds
|
8
|
+
from company_fundamentals.utils import get_fundamental_mappings
|
9
|
+
from company_fundamentals import construct_fundamentals
|
8
10
|
# slated for deprecation?
|
9
11
|
from .seclibrary.bq import get_information_table, get_345, get_proxy_voting_record
|
10
12
|
|
@@ -21,7 +23,25 @@ class Sheet:
|
|
21
23
|
|
22
24
|
def get_table(self,table,cik=None,ticker=None,**kwargs):
|
23
25
|
cik = _process_cik_and_metadata_filters(cik, ticker)
|
24
|
-
|
26
|
+
|
27
|
+
if table == 'fundamentals':
|
28
|
+
fundamentals = kwargs.pop('fundamentals', None)
|
29
|
+
if fundamentals is None:
|
30
|
+
raise ValueError("fundamentals parameter required for fundamentals table")
|
31
|
+
|
32
|
+
categories = kwargs.pop('categories',None)
|
33
|
+
|
34
|
+
mappings = get_fundamental_mappings(fundamentals=fundamentals)
|
35
|
+
#print(mappings)
|
36
|
+
taxonomies = [item[0] for item in mappings]
|
37
|
+
names = [item[1] for item in mappings]
|
38
|
+
xbrl = query_mysql_rds(table='simple_xbrl',cik=cik,taxonomy=taxonomies,name=names,**kwargs)
|
39
|
+
#print(xbrl)
|
40
|
+
|
41
|
+
return construct_fundamentals(xbrl, 'taxonomy', 'name', 'period_start_date', 'period_end_date', categories=categories,fundamentals=fundamentals)
|
42
|
+
|
43
|
+
else:
|
44
|
+
return query_mysql_rds(table=table,cik=cik,**kwargs)
|
25
45
|
|
26
46
|
def download_xbrl(
|
27
47
|
self,
|
@@ -5,13 +5,13 @@ datamule/index.py,sha256=Rrcna9FJV-Oh_K6O2IuUEIDmtay_7UZ4l4jgKCi7A7I,2079
|
|
5
5
|
datamule/package_updater.py,sha256=Z9zaa_y0Z5cknpRn8oPea3gg4kquFHfpfhduKKCZ6NU,958
|
6
6
|
datamule/portfolio.py,sha256=YViG1JgJ9SFhg8N3tOOhBI8oc6Pmi2vwnHeHmlkC_5U,12119
|
7
7
|
datamule/portfolio_compression_utils.py,sha256=8OPYEN5zAdV1FiTxgVN3S7cTKs99Elv74bwgoIJP4QY,12654
|
8
|
-
datamule/sheet.py,sha256=
|
8
|
+
datamule/sheet.py,sha256=Ws_YRtpvewLVioarngVMe8cgG_sp11MP9_goGbRaiWE,23952
|
9
9
|
datamule/submission.py,sha256=TkD_SVCEGjxOmHm5hjQm69j8DqQWr3YtgjTdKRWm26k,11205
|
10
10
|
datamule/data/listed_filer_metadata.csv,sha256=dT9fQ8AC5P1-Udf_UF0ZkdXJ88jNxJb_tuhi5YYL1rc,2426827
|
11
11
|
datamule/datamule/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
datamule/datamule/datamule_lookup.py,sha256=e8djAg-ctSyHiKk7BjbtgugZ3p8roUjzsym5z3AihUg,9468
|
13
13
|
datamule/datamule/datamule_mysql_rds.py,sha256=Oj_xPTBKkzWsuRlb_tphjJrBW1eua1cOuxjGwJx581k,10591
|
14
|
-
datamule/datamule/downloader.py,sha256=
|
14
|
+
datamule/datamule/downloader.py,sha256=852aKx_40vWNrPqD_vobjNqwe8ZS85NprtdKSSSkjo0,18515
|
15
15
|
datamule/datamule/sec_connector.py,sha256=VwOaODpHoAWy8JIky6kLR1-orW_PB61RHw7pIGRpkow,3288
|
16
16
|
datamule/document/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
datamule/document/document.py,sha256=wr7gup139l7wJl8xiipROMo9in_44wAl27Rb__tpb84,16770
|
@@ -65,7 +65,7 @@ datamule/seclibrary/bq.py,sha256=C8sb_rpXTvchprrFLcbRar4Qi0XWW25tnv1YsHSS5o4,180
|
|
65
65
|
datamule/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
66
66
|
datamule/utils/construct_submissions_data.py,sha256=NB_hvfxlRXPyt4Fgc-5qA8vJRItkLhBedCSTaxwW7Jg,5887
|
67
67
|
datamule/utils/format_accession.py,sha256=60RtqoNqoT9zSKVb1DeOv1gncJxzPTFMNW4SNOVmC_g,476
|
68
|
-
datamule-2.0.
|
69
|
-
datamule-2.0.
|
70
|
-
datamule-2.0.
|
71
|
-
datamule-2.0.
|
68
|
+
datamule-2.0.2.dist-info/METADATA,sha256=WlcxDW54ca01HEHCO-0s9dETivEsNtjiDgPjfgZBHcA,560
|
69
|
+
datamule-2.0.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
70
|
+
datamule-2.0.2.dist-info/top_level.txt,sha256=iOfgmtSMFVyr7JGl_bYSTDry79JbmsG4p8zKq89ktKk,9
|
71
|
+
datamule-2.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|