Skip to main content

numeraire-dataset

PyPI Python versions CI License: BSD-3-Clause

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. Part of the numeraire ecosystem.

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.

Citation

numeraire-dataset is a companion to numeraire. If you use the ecosystem in your research, please cite numeraire — see How to cite.

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

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.1.tar.gz (230.9 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.1-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: numeraire_dataset-0.1.1.tar.gz
  • Upload date:
  • Size: 230.9 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.1.tar.gz
Algorithm Hash digest
SHA256 294ed16e0c6d4bd8290473467a21c018f5155e515c89d91d2429091a013db89f
MD5 f559257718d5b8e76e3ef573ef11d4c3
BLAKE2b-256 5e8101824e4d8a2982a5c61571b63124a18de47c898a889156af7694808f77e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for numeraire_dataset-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for numeraire_dataset-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11f5181b471e58c4c46c96fafeab068c32a59714affd1f30d4137116459811f4
MD5 59560afcba882d99d9e27d86957a54b1
BLAKE2b-256 7f92913cc55dd6839cabc81a5c756fe5954ff67c1babcd03a15336dc6dccb603

See more details on using hashes here.

Provenance

The following attestation bundles were made for numeraire_dataset-0.1.1-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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page