A package to standardize XBRL into fundamentals data
Project description
Company Fundamentals
A minimal python package to construct company fundamentals such as EPS, P/E, EBITDA, Gross Margin and more.
Installation
pip install company-fundamentals
Usage
Takes dictionaries with taxonomy and concept, then standardizes and calculates fundamental values. Powers the datamule project.
sample_simple_xbrl = [
{'taxonomy': 'us-gaap', 'name': 'NetIncomeLoss', 'value': '120000', 'period_start_date': '2024-01-01', 'period_end_date': '2024-12-31'},
{'taxonomy': 'us-gaap', 'name': 'NetIncomeLoss', 'value': '100000', 'period_start_date': '2023-01-01', 'period_end_date': '2023-12-31'},
]
fundamentals = construct_fundamentals(data=sample_simple_xbrl, taxonomy_key='taxonomy', concept_key='name, start_date_key='period_start_date', end_date_key='period_end_date', categories=None)
print(fundamentals)
Returns a dictionary of fundamentals
{'incomeStatement': {'netIncome': [{'value': '120000', 'period_start_date': '2024-01-01', 'period_end_date': '2024-12-31'}, {'value': '100000', 'period_start_date': '2023-01-01', 'period_end_date': '2023-12-31'}], 'netIncomeGrowth': [{'value': 0.2, 'period_start_date': '2024-01-01', 'period_end_date': '2024-12-31'}]}}
Use categories to subset what fundamentals you would like to construct
fundamentals = construct_fundamentals(data=sample_simple_xbrl, taxonomy_key='taxonomy', concept_key='name, start_date_key='period_start_date', end_date_key='period_end_date', categories=['incomeStatement'])
Package Design
- Mappings are stored as a dictionary in mappings.py. This is used to standardize different xbrl reporting taxonomies.
- Calculations are stored as a dictionary in calculations.py. This is used to determine how fundamentals are calculated.
TODO
- Bug testing
- More Fundamentals
- Performance Improvements
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file company-fundamentals-0.0.1.tar.gz.
File metadata
- Download URL: company-fundamentals-0.0.1.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16f557f48278f2c950c0b2a39e51f4e9125e6b9c62c404b8fbba1fe298ef037a
|
|
| MD5 |
bf00cb6da6645c68009a6cb73380ab12
|
|
| BLAKE2b-256 |
6fe688df1a57170110972bfdc801b0185b8735023a5c0e4b34d3085a2448b42a
|
File details
Details for the file company_fundamentals-0.0.1-py3-none-any.whl.
File metadata
- Download URL: company_fundamentals-0.0.1-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
425b28ce7ce7f0249916b0bbac39286a7d4b8a7157106ce4f6562a68da43608e
|
|
| MD5 |
ee2bff15e947c46a1dd84d89b65a6d13
|
|
| BLAKE2b-256 |
4c97a74cfd5377b27b3f56fdfcdc044c966d3a746f8eefe55449ef4477cc1016
|