API reference#
The public surface: tidyfinance-backed sources loaders, the self-built FRED-MD builder, and the complete raw/clean/lock step lifecycle for locally pulled WRDS panels.
Sources#
Fama-French 3-factor tidy frame ( |
|
Ken French U.S. |
|
A public Ken French portfolio frame in decimal returns. |
|
Ken French multi-asset view plus a non-secret |
|
Official Hou--Xue--Zhang q4 factors as month-end decimal returns. |
|
Official HXZ 2x3x3 size/investment/profitability portfolios in decimal returns. |
|
Official Pastor--Stambaugh aggregate-liquidity snapshot, with explicit units. |
|
Official historical-liquidity-beta decile returns and traded 10-minus-1 factor. |
|
Load a caller-supplied AQR BAB Original workbook as decimal monthly returns. |
|
Load caller-supplied Daniel--Moskowitz daily/monthly momentum deciles. |
|
Load the fixed He--Kelly--Manela paper factors and 124 test assets. |
|
Goyal-Welch equity-premium frame: |
|
Goyal-Welch view (excess |
|
A tidy wide |
|
A tidy |
|
Provenance stamp for a live tidyfinance pull ( |
|
Return the non-secret |
|
Return a copy of source provenance attached by a public frame loader. |
|
Built-in immutable sequence. |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
Explicit parser and release envelope for one documented archive member. |
|
Paired daily/monthly contract for the total-return, all-firm portfolios. |
|
Canonical paired momentum-decile frames returned by the path-only loader. |
|
Fixed paper-sample factors and the unbalanced 124-test-asset panel. |
|
One asset class aligned on its joint complete-case paper sample. |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
Built-in immutable sequence. |
|
Built-in immutable sequence. |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
Built-in immutable sequence. |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
Builders — FRED-MD#
Download recent FRED-MD single vintages ( |
|
Download a full-history zip ( |
|
Read one FRED-MD vintage file → |
|
Apply a FRED-MD stationarity transform (codes 1-7) to a level series (NaN-padded at start). |
|
Stack FRED-MD vintage files into a wide point-in-time table |
|
Build from every vintage CSV under |
WRDS clean steps#
These functions transform caller-supplied frames and do not connect to WRDS themselves.
Tidy monthly CRSP: common-stock filter, delisting-adjusted returns, month-end mktcap. |
|
Validate one CRSP daily-equity bucket without imputing an observation. |
|
Strictly align the CRSP value-weighted market and daily Fama--French risk-free rate. |
|
Subtract the same-date daily RF from one clean stock bucket. |
|
Normalize WRDS Fama--French monthly RF from source-month labels to month-end. |
|
Attach same-month RF and an excess return to one clean monthly stock bucket. |
|
Tidy annual Compustat: book equity, operating profitability, and asset-growth investment. |
|
Prepare raw annual accounting fields for calendar-year portfolio formation. |
|
Tidy quarterly Compustat: fresh-earnings ROE with an announcement-dated availability month. |
|
Tidy CRSP-Compustat links: primary, reliable gvkey<->permno links with valid date windows. |
Data-zone provenance and step registry#
A built frame plus the step identity and explicit inputs committed by its recipe hash. |
|
An in-memory |
|
The |
|
A registered transform: a pure function plus its identity and input/output artifact names. |
|
Return the names of all registered steps, sorted. |
|
Digest a frame's values and semantic schema, preserving row/column order. |
|
The numeraire |
|
Return the step registered under |
|
Return and create the cache directory for a |
|
Read the |
|
Hash a recipe whose canonical input mapping preserves each input's semantic role. |
|
Register |
|
Run a registered step on named input frames, returning the output + its provenance hashes. |
|
Create a new |
WRDS connector and cache#
These functions require the optional wrds dependency only when opening a live connection. Cached
reads and deterministic clean builds remain usable without live credentials.
Open a WRDS connection using credentials from the environment (or explicit arguments). |
|
The default raw-vintage stamp for a WRDS pull, resolved at call time. |
|
Pull the standard raw tables, run the clean builders, and record the provenance lock. |
|
Pull |
|
Pull (and cache) the standard raw tables; returns |
|
Whether a complete parquet + metadata cache exists for |
|
Read a cached raw frame after validating its metadata, schema, and values. |
|
Whether WRDS credentials are reachable in the environment (no connection is attempted). |
Partitioned WRDS equity collections#
Daily and monthly CRSP histories are intentionally exposed as iterator-backed collections rather
than one materialized frame. The default is 64 stable permno buckets. Daily SIZ and CIZ have
different SQL, cache labels, manifests, and data_vintage values. Licensed rows stay in the data
home; the collection manifest contains only query/content identities, row/date bounds, and unit
contracts. It also binds the registered clean pipeline’s step names, versions, and explicit
parameters into data_vintage. Monthly targets are SIZ-only and keep stock, name-history, and
delist pulls independent; sensitivity transforms must use the raw iterator plus run_step so they
receive their own recipe identity.
Handle for a complete partitioned daily-equity input collection. |
|
Non-secret identity of one independently cached raw input. |
|
SIZ monthly target returns, streamed as independent |
|
Path-free identity of one monthly SIZ target input. |
|
Three independently pulled raw frames for one monthly |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
Return deterministic SQL for one complete-history |
|
CRSP value-weighted U.S. |
|
Daily U.S. |
|
One SIZ monthly-stock bucket, independent of names and delisting events. |
|
Name histories overlapping the target range for one SIZ |
|
Monthly delisting events pulled independently so terminal-only rows cannot disappear. |
|
Monthly FF RF in decimal units; WRDS source dates label months at their first day. |
|
Legacy monthly inputs for |
|
Pull/cache one bucket at a time and publish its complete collection manifest. |
|
Load a completed collection manifest without opening a WRDS connection. |
|
Pull a complete SIZ monthly target collection, bounded by one bucket in memory. |
|
Load a complete monthly SIZ target manifest without opening a WRDS connection. |
Numeraire view bridge#
Build a numeraire |