datamule 2.0.0__py3-none-any.whl → 2.0.1__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/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
- return query_mysql_rds(table=table,cik=cik,**kwargs)
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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datamule
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Work with SEC submissions at scale.
5
5
  Home-page: https://github.com/john-friedman/datamule-python
6
6
  Author: John Friedman
@@ -5,7 +5,7 @@ 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=GnF9wA42iDw6purPmgshALymFssBp7gjmfjIs86CNJY,22997
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
@@ -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.0.dist-info/METADATA,sha256=Gg6gAtm4lGxYuXLiqNB8VtP0pb1A922QvKRw9kgCegk,560
69
- datamule-2.0.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
70
- datamule-2.0.0.dist-info/top_level.txt,sha256=iOfgmtSMFVyr7JGl_bYSTDry79JbmsG4p8zKq89ktKk,9
71
- datamule-2.0.0.dist-info/RECORD,,
68
+ datamule-2.0.1.dist-info/METADATA,sha256=DK6UPncyMfZZ1smZFXpY29iFAMPh93rfT7M5LNpecoc,560
69
+ datamule-2.0.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
70
+ datamule-2.0.1.dist-info/top_level.txt,sha256=iOfgmtSMFVyr7JGl_bYSTDry79JbmsG4p8zKq89ktKk,9
71
+ datamule-2.0.1.dist-info/RECORD,,