Skip to main content

Ready-to-run FinField scrapers: SEC EDGAR fundamentals, Stooq equity prices, CoinGecko crypto — pure Python, stdlib HTTP, normalized to FinFacts

Project description

finscrapers

Source adapters that turn open financial data into deterministic finfacts — scaled integers, per-fact provenance, byte-identical CIDs on every node that reads the same upstream bytes.

Ready scrapers

kind coverage rate / ToS notes
sec-companyfacts US fundamentals — every XBRL fact filed by every US-listed reporter (audited, full history, per-fact accession provenance), public-domain JSON from data.sec.gov SEC asks for <=10 req/s and a descriptive User-Agent (both built in: default throttle 0.12 s, UA with contact); companyfacts.zip bulk mode for full-universe ingest
stooq-eod Equity end-of-day close/volume — US, DE, GB, JP, HU, PL composite tickers, plain CSV with exact decimal strings stooq.com free tier, no API key; be polite, cache aggressively
coingecko-market Crypto daily close/volume (USD) for the liquid core (BTC CRYPTO, ETH CRYPTO, …; pass id_map for the long tail); JSON parsed with parse_float=Decimal, no float round-trip CoinGecko free tier, no API key, low rate limits — cache and space out calls

Crypto (and any cross-venue) prices are continuous quantities: two nodes scraping at different moments legitimately mint different facts for the same day. Each observation is published as-is; the field converges through vank voting in finknit.vote, never by pretending the number was exact.

Adding a scraper: the FactSource contract

from finscrapers import FactSource

class MySource(FactSource):
    kind = "my-source"                                  # unique source id

    def covers(self, entity) -> bool: ...               # can I supply facts for it?
    def fetch(self, entity):                            # -> FactSet | None
        ...  # normalize upstream numbers via to_scaled — never floats

Register it in finscrapers.registry.READY (or pass your own dict to the runner). all_sources(cache_dir) instantiates every ready scraper, each with its own cache subdirectory.

Install & fetch

pip install "finscrapers @ git+https://github.com/FinField/scrapers"   # pulls finfacts
from pathlib import Path
from finscrapers import SecEdgarSource
from finfacts.model import Entity

src = SecEdgarSource(cache_dir=Path("~/.cache/finfield/sec").expanduser())
fs = src.fetch(Entity(ticker="AAPL US", cik="320193"))
print(len(fs.facts), fs.facts[0].cid)   # audited XBRL facts, ff1:… CIDs

On 5mart.ml/finfield these scrapers run unattended as knitting agents via agents: each agent fetches, derives, and weaves signed facts into the pulse fabric on a schedule.

Part of the FinField field: facts · 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

finscrapers-0.1.0.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

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

finscrapers-0.1.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for finscrapers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5cf2efc76b07edcf96a6f8b335ba6880120259d720278c96c96f33810d1fbbc1
MD5 c1af1803af9a62cd219484d836f45870
BLAKE2b-256 820676ef5b350622ca38e3657831823261e832951de43c15301086e7f4580fbb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for finscrapers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae0772db92e4d33ed57164ae5d1b770ae6239f210a651ff99dddcadb51982b9c
MD5 3233b779292b3025323e2670e6e61bfe
BLAKE2b-256 a257f18e86435c41a4b5a8313ba034d697cf475ff31c2b0ed849c3ad12c44543

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