Skip to main content

FinField data model: provenance-first financial facts with scaled-integer values, deterministic CIDs, a 20,000+ company universe and exact derived metrics

Project description

finfacts

The FinField data model — the shared foundation every other FinField repo builds on.

  • FinFact — one atomic financial fact: entity, concept, value, unit, period, source. Values are scaled integers (value * 10^-scale), never floats: the knitweb canonical path forbids floats, and consensus on continuous quantities runs through vank (see FinField/knit).
  • Deterministic CIDs — canonical JSON + SHA-256, so two nodes ingesting the same source mint byte-identical facts and P2P replication converges without coordination.
  • Universe — 20,699 listed companies (open identifiers only: ticker, CIK, LEI, FIGI).
  • derive — exact derived metrics (TTM, margins, YoY growth) whose derived_from chain traces every ratio back to the audited filing.

Pure Python, zero dependencies.

pip install "finfacts @ git+https://github.com/FinField/facts"
from finfacts import FinFact, Period, Source, to_scaled, universe

value, scale = to_scaled("391035000000")  # exact, no float in sight
fact = FinFact(entity_id="ticker:AAPL US", concept="us-gaap:Revenues",
               value=value, scale=scale, unit="USD",
               period=Period(end="2024-09-28", start="2023-10-01"),
               source=Source(kind="sec-companyfacts", ref="0000320193-24-000123"))
print(fact.cid)  # ff1:… — same bytes, same CID, on every node

Part of the FinField field: scrapers · knit · agents · signals · crypto

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

finfacts-0.1.0.tar.gz (234.9 kB view details)

Uploaded Source

Built Distribution

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

finfacts-0.1.0-py3-none-any.whl (236.3 kB view details)

Uploaded Python 3

File details

Details for the file finfacts-0.1.0.tar.gz.

File metadata

  • Download URL: finfacts-0.1.0.tar.gz
  • Upload date:
  • Size: 234.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for finfacts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2978f26280fa4b1aa2db0ccbb9ed1674993627e44e84e522adda85a8c0570927
MD5 7df67420d137e041c649fa305f2f1554
BLAKE2b-256 60b1e68928eb67f1fa245d8124880ea80cf30bc2f2f789fee78d014c9ed81bda

See more details on using hashes here.

File details

Details for the file finfacts-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: finfacts-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 236.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for finfacts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be384b391a3a10c4a2e6a218cc2a8b409c11ebc1ea8d7bad64cfd7a36d51d3ee
MD5 9e9b5825b1e7b914bc95e75197ac0474
BLAKE2b-256 c6a542968a714ee7767f0af824c0ad0538670ac1a8d654bc084fe567c817d6e4

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