quantlab.acquisition.wrds.rebuild.CrspStoreRebuilder#
- class quantlab.acquisition.wrds.rebuild.CrspStoreRebuilder(config, *, data_root)[source]#
Bases:
BaseStoreRebuilderRe-convert one CRSP store from the raw files and measure the result.
Constructor parameters are those of
BaseStoreRebuilder: aCrspDatasetConfiganddata_root, the directory that relative config paths are resolved against.Examples
>>> from quantlab.dataset.config import CrspDatasetConfig >>> from quantlab.acquisition.wrds.rebuild import CrspStoreRebuilder >>> config = CrspDatasetConfig( ... zarr_file_path="data/data/us_equity/1d/crsp.zarr", ... raw_data_dir_path="data/downloads/us_equity/1d/wrds_crsp/wrds", ... reference_dir="data/downloads/us_equity/1d/wrds_crsp/_reference", ... start_date="2024-01-01", ... end_date="2024-12-31", ... security_filter="equity_common", ... roster_universe="crsp_sp500", ... ) >>> rebuilder = CrspStoreRebuilder(config, data_root="/path/to/repo") >>> [p.name for p in rebuilder.sidecar_paths()][:2] ['crsp.zarr.chunks.json', 'crsp.zarr.crsp_adjustment.json'] >>> measurement = rebuilder.rebuild(backup_dir=Path("/path/to/backup"))
The last line needs real raw and reference files under
data_root; without themrebuildrefuses before deleting anything.- SIDECAR_SUFFIXES = ('.chunks.json', '.crsp_adjustment.json', '.crsp_filter_report.json', '.crsp_symbology_report.json', '.crsp_tickers.json')#
Suffixes appended to
store_pathto name the store’s sidecars, the small bookkeeping files kept next to the store directory.()means the store has none.clear()deletes them together with the store.