Skip to main content

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 companyfundamentals

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

  1. Mappings are stored as a dictionary in mappings.py. This is used to standardize different xbrl reporting taxonomies.
  2. Calculations are stored as a dictionary in calculations.py. This is used to determine how fundamentals are calculated.

TODO

  1. Bug testing
  2. More Fundamentals
  3. 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

company_fundamentals-0.0.3.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

company_fundamentals-0.0.3-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file company_fundamentals-0.0.3.tar.gz.

File metadata

  • Download URL: company_fundamentals-0.0.3.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for company_fundamentals-0.0.3.tar.gz
Algorithm Hash digest
SHA256 84c8d8e83c62dc1acc658a44ff1631ceb2fc480221a882dc1a59ccaf5314b492
MD5 876fa92a956182cbb1903549b4cc653f
BLAKE2b-256 d79705e679ef95846df9fa14d0bdce8c20c39f3aeeda2ed94042aa85db743f47

See more details on using hashes here.

File details

Details for the file company_fundamentals-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for company_fundamentals-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ec5b42fd0831c1fb42bc293db9977d61978fa998dbd1f061c202f7380aebb8d3
MD5 8c7baf0cc8d6c747572f1abd6f6e4a2f
BLAKE2b-256 7a1ca55ebc075b59a2ef3657453e2948a06c11fa754e6343b423f7b33be3a2ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page