quantlab.dataset.crsp.reference#

Readers for the CRSP reference tables, six whole tables stored next to the raw daily data.

CRSP (the Center for Research in Security Prices) is a US stock database sold through WRDS (Wharton Research Data Services). A PERMNO is CRSP’s permanent integer id for one security. Compustat is S&P’s fundamentals database, also on WRDS, which identifies a company by gvkey.

CRSP’s daily table says what happened to a security on a given day. It does not say what the security was called at the time, when it was delisted, whether it was in the S&P 500, or which Compustat security it matches. Those facts live in small tables that are downloaded whole, once, and read many times; together they are the reference tier (a tier is one layer of files on disk, next to the raw tier of daily price files). This module declares which tables make up the reference tier, with their columns and types (ReferenceTableSpec), and provides CrspReference, a read-only accessor for one reference directory.

The reference tier lives in .../wrds_crsp/_reference/, next to the raw root .../wrds_crsp/wrds/ rather than inside it. The raw scan reads every parquet file below the raw root, so it never picks up a reference table or the manifest.

The module imports only polars and the standard library. Anything that reads the reference tables (the CRSP dataset, the constituent datasets, the roster helpers) therefore works on a machine with no WRDS login and no database driver. Downloading the tables is a separate acquisition step.

Classes

CrspReference

Read-only access to one CRSP reference directory.

ReferenceTableSpec

One reference table: where it lives on the WRDS server and its schema.