Skip to main content

Official Python SDK for the Valuein US Core Fundamentals dataset — SEC EDGAR financials via API.

Project description

PyPI version Python 3.11+ License CI

Financial Data Essentials (FDE)

Institutional-grade SEC fundamental data. Point-in-Time accurate, survivorship-bias free.

Standardized US Core Fundamentals (10-K, 10-Q, 8-K) sourced directly from SEC EDGAR. 20,000+ active and delisted entities. ~105M standardized facts. Coverage from 1990 to present.


Quickstart

pip install valuein-sdk
export VALUEIN_API_KEY="your_key"   # get one at valuein.biz
from valuein_sdk import ValueinClient

client = ValueinClient()
df = client.query("SELECT symbol, report_date, standard_concept, numeric_value FROM fact JOIN filing USING (accession_id) JOIN security USING (entity_id) WHERE symbol = 'AAPL' ORDER BY report_date DESC LIMIT 10")
print(df)

No downloads. DuckDB streams only the rows your query needs directly from Cloudflare R2.


Why Valuein FDE

Feature Detail
Point-in-Time (PIT) Every fact carries filing_date — the date the SEC received the filing. Filter by filing_date <= trade_date to eliminate look-ahead bias.
Survivorship-bias free Includes all 20,000+ entities ever listed, including delisted, bankrupt, and acquired companies.
Standardized concepts 15,000+ raw XBRL tags mapped to ~150 consistent metrics via waterfall logic. Restatements appended, never overwritten.
Zero-copy DuckDB The SDK registers an authenticated DuckDB HTTP secret. Your SQL runs instantly — no local caching required.
40+ SQL templates Ready-to-run queries for Altman Z-score, DuPont decomposition, TTM, FCF, sector screening, and more.

Point-in-Time Backtesting

Always gate on filing_date, not report_date, to avoid trading on data the market did not yet have:

# Only use information available to the market on 2024-01-15
df = client.query("""
    SELECT fa.standard_concept, fa.numeric_value, f.filing_date
    FROM fact fa
    JOIN filing f ON fa.accession_id = f.accession_id
    JOIN security s ON f.entity_id = s.entity_id
    WHERE s.symbol = 'MSFT'
      AND f.filing_date <= '2024-01-15'   -- PIT gate
    ORDER BY f.report_date DESC
    LIMIT 10
""")

Available Tables

Table Description
entity Legal company entities — CIK, name, sector, SIC code
security Ticker symbols with date ranges (valid_from, valid_to, is_active)
filing SEC filing metadata — form type, filing_date, report_date, accession number
fact Standardized financial facts — standard_concept, numeric_value, unit
taxonomy_guide Human-readable definitions for all 150+ standard concepts
index_membership Historical S&P 500 and other index constituent records

Pre-built SQL Templates

df = client.run_template(
    "01_fundamentals_by_ticker",
    ticker="NVDA",
    form_types=["10-K"],
    metrics=["Revenues", "NetIncomeLoss", "OperatingIncomeLoss"],
    start_date="2020-01-01",
    end_date="2026-01-01",
)

40+ templates in valuein_sdk/queries/ — Altman Z-score, DuPont, TTM, FCF, sector screening, bankruptcy signals, and more.


API Reference

client = ValueinClient(api_key="...", gateway_url="...")  # gateway_url for local dev only

client.query(sql)                    # Run arbitrary DuckDB SQL → DataFrame
client.get(table)                    # Download full table → DataFrame
client.run_template(name, **kwargs)  # Run a named .sql template → DataFrame
client.tables()                      # List available table names
client.me()                          # Token details: plan, status, email
client.manifest()                    # Snapshot metadata: snapshot ID, last_updated

Exception hierarchy:

from valuein_sdk import (
    ValueinError,         # base class
    ValueinAuthError,     # HTTP 401/403 — invalid or revoked token
    ValueinPlanError,     # HTTP 403 — resource requires Full Dataset plan
    ValueinNotFoundError, # HTTP 404
    ValueinRateLimitError,# HTTP 429 — includes .retry_after seconds
    ValueinAPIError,      # HTTP 5xx or unexpected status
)

Examples

Notebook Description
quickstart.ipynb Install, authenticate, first query Open In Colab
backtest_pit.ipynb Point-in-Time backtest walkthrough Open In Colab
screening.ipynb Fundamental factor screening across the S&P 500 Open In Colab
bankruptcy_analysis.ipynb Altman Z-score and distress signals Open In Colab

Documentation


For research and educational purposes only. Not financial advice.

Apache-2.0 License — see LICENSE.

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

valuein_sdk-0.3.1.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

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

valuein_sdk-0.3.1-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file valuein_sdk-0.3.1.tar.gz.

File metadata

  • Download URL: valuein_sdk-0.3.1.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for valuein_sdk-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d7a78320d50bdad51c829058601f2fde61bd221e4d9207740f6d888e98af57fb
MD5 4430cf2ef87a9f286444535d1d53390d
BLAKE2b-256 e136b21c99355e040826d5429f5712026f004ccf9ee02c7d5e0fcc44e476598d

See more details on using hashes here.

Provenance

The following attestation bundles were made for valuein_sdk-0.3.1.tar.gz:

Publisher: publish.yml on valuein/quants

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file valuein_sdk-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: valuein_sdk-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 42.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for valuein_sdk-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50d716cb8ef449ff4925508f5e8a168edb1418bc58555cce15cabc7ab6059ce1
MD5 df27b17d397f3363df2ab271a797a852
BLAKE2b-256 2678f28dbb8fcea090427325d19282706d0b24003b4556f57d18cda308eccaba

See more details on using hashes here.

Provenance

The following attestation bundles were made for valuein_sdk-0.3.1-py3-none-any.whl:

Publisher: publish.yml on valuein/quants

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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