Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

FinField data model — scaled-integer FinFacts (never floats), deterministic CIDs, 20k+ company universe, exact derived metrics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages