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.4.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.4-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: company_fundamentals-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 3848c0b77cf5069dbf820a8f228bf1facacb1151c1b25edc926d39faea24cd21
MD5 c77d1d052fbeb80c927e8460ea50e58e
BLAKE2b-256 abf9b5566deec4b7de83cdf27c4a779b6fca79cc75f7abfc0247a9e2d289c208

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for company_fundamentals-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bcdd62a19fcd6b8ac06cc456e7ff3929fac9c0ea4ba0d1de1c776b8c3180488e
MD5 6ef198705f16c5e52e3aad9f83ac0ab1
BLAKE2b-256 29af618c917b4cf06323fac5cd96a5e72a5c8aba1d72bc8f077c86acad32238d

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