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.2.2.tar.gz (27.2 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.2.2-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: valuein_sdk-0.2.2.tar.gz
  • Upload date:
  • Size: 27.2 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.2.2.tar.gz
Algorithm Hash digest
SHA256 970fdbf4e2041b361d6cd3b6c10361386d5a4a6188e659d23fe2eb5e41408372
MD5 8c631ee780fc4e03ae7fd7f06b932475
BLAKE2b-256 b61b5cf22d17fee2365122a35a95b294ef3fe6129aa47210492394f41c657f0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for valuein_sdk-0.2.2.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.2.2-py3-none-any.whl.

File metadata

  • Download URL: valuein_sdk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 42.1 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.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0905218c33ae14a8d3d7dfd352a7db5e5e569a997380e4e480e6923ebd40fc4e
MD5 2db3bd0ae5db1d7069befd0acac89ba1
BLAKE2b-256 51019bf55d969910ce6ee4f09b684c779de83a44e2840c8c7f7e3993df6d7c82

See more details on using hashes here.

Provenance

The following attestation bundles were made for valuein_sdk-0.2.2-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