Skip to main content

Open data builders for numeraire: fetch + clean public and WRDS-sourced data into tidy, point-in-time tables.

Project description

numeraire-dataset

Open, reproducible data loaders + builders for numeraire. This package ships code, not data: it fetches public (and, with your own WRDS credentials, licensed) sources and cleans them into tidy, point-in-time tables that numeraire consumes.

Install

pip install numeraire-dataset               # frame loaders + builders (tidyfinance backend)
pip install "numeraire-dataset[numeraire]"  # + the point-in-time view helpers (numeraire bridge)
pip install "numeraire-dataset[wrds]"       # + live CRSP/Compustat pulls (your own WRDS account)

Two layers

  • sourcestidyfinance (MIT) is the primary backend for standard sources (Fama-French, Goyal-Welch, FRED, JKP, q-factors, OSAP). Thin loaders return tidy frames (+ an optional point-in-time view helper) with data_vintage provenance — no loader hand-rolling.
  • builders — self-built ETL for what tidyfinance does not cover: vintage-aware FRED-MD (reference period × vintage × series, tcodes applied at build time) and, with your own credentials, WRDS panels. (The FRED-MD vintage/tcode design is a candidate to upstream into tidyfinance — once merged, its sources path could replace the local builder.)

Why a separate project

numeraire (the framework) bundles only tiny public example slices. Anything that needs to be downloaded, merged across releases, or built from a subscription source lives here, as transparent open-source ETL — so the cleaning is auditable and re-runnable, and no licensed data is ever redistributed inside a wheel. Build outputs land in a local cache (git-ignored), never the repo.

Design: build once, read clean

raw vendor files  ──build (this package)──▶  tidy point-in-time table  ──read──▶  numeraire
   (download)            clean / tcode                [reference period × vintage × series]
  • The vintage axis is a column. Each value carries the reference period it describes and the vintage (data release) it came from, so revisions are first-class and asof is leak-safe.
  • Stationarity transforms (FRED-MD tcodes) are applied at build time, per vintage — never inside numeraire's main pipeline. transform=False keeps raw levels.
  • Availability lag (L) is NOT baked in. It stays a read-time parameter in numeraire, so you can sweep it for robustness. The table stores only (reference period, vintage, series…).

Builders

Builder Source License of output Status
fredmd FRED-MD monthly vintages (St. Louis Fed, McCracken-Ng) public (cite McCracken-Ng 2016) in progress
famafrench Ken French Data Library public (cite, carry copyright notice) planned
zones.wrds CRSP / Compustat panels (your WRDS account) not redistributable — local only implemented

Usage

# Standard sources via tidyfinance (frames; + a view helper with the `numeraire` extra):
from numeraire_dataset import load_ff_factors, load_gw_view

ff = load_ff_factors()                       # date, mkt_excess, smb, hml, risk_free  (decimals)
view, vintage = load_gw_view(start_date="1926-07-01", end_date="2020-12-31")
# → feed `view` straight into numeraire's backtest_forecast; `vintage` is the provenance stamp.

# Vintage-aware FRED-MD (what tidyfinance lacks) via the local builder:
from numeraire_dataset.builders import fredmd

paths = fredmd.download(vintages=["2025-01", "2025-02", "2025-03"], dest="~/.numeraire_data")
table = fredmd.build_table(paths, transform=True)   # tidy [reference, vintage, series…]

Frame loaders vs. *_view helpers

The split is intentional, not an oversight. Frame loaders (load_ff_factors, load_goyal_welch) return plain tidy pandas frames and carry no numeraire dependency, so they are usable on their own. The *_view helpers (load_gw_view, zones.view) add the optional bridge into a numeraire view plus a data_vintage stamp, and only import numeraire lazily (install the [numeraire] extra). A frame loader is therefore a strict subset of the work a view helper does — the names differ because their return contracts and dependency footprints differ, and both are kept rather than collapsed into one signature.

License: BSD-3-Clause (code). Source datasets keep their own terms — see each builder's docstring.

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

numeraire_dataset-0.1.0.tar.gz (210.0 kB view details)

Uploaded Source

Built Distribution

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

numeraire_dataset-0.1.0-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: numeraire_dataset-0.1.0.tar.gz
  • Upload date:
  • Size: 210.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for numeraire_dataset-0.1.0.tar.gz
Algorithm Hash digest
SHA256 764dadd197ce11d0433f64f4936f48b598ab241a838a2a9e1bfc48c6783e9d48
MD5 b83c7c27088a6d3d2f01fe6d04dfffe1
BLAKE2b-256 686c25733d077f29ba25cdbe02d596a00e719f24f91186ef2a33131de751ab3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for numeraire_dataset-0.1.0.tar.gz:

Publisher: publish.yml on py-numeraire/numeraire-dataset

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

File details

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

File metadata

File hashes

Hashes for numeraire_dataset-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d6315912d39cceceac4f04e38e7bd359fd5cfdf24ed09cfc3f8bb8607ee145d
MD5 927c31e13979117ac44473cabb826de9
BLAKE2b-256 80e34a6f4d630ca6405b2ecf35c889de8ccc469fd5f80e247f00a4109138a5da

See more details on using hashes here.

Provenance

The following attestation bundles were made for numeraire_dataset-0.1.0-py3-none-any.whl:

Publisher: publish.yml on py-numeraire/numeraire-dataset

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