quantlab.config#

The data root, and config factories for the US-equity datasets and universe table.

Each factory builds one config dataclass with every storage path derived from a single data root. (The acquisition factory, stock_acquisition_config, lives beside AcquisitionConfig in quantlab.acquisition.config.) get_data_root resolves that root from, in order, the process-level override set through set_data_root, the QUANTLAB_DATA_DIR environment variable, and finally a default: the data/ directory beside the repository in a source checkout, so a fresh clone works with no configuration, and ~/.quantlab/data in an installed package. Beneath the root, raw downloads live under downloads/{market}/{frequency}/, Zarr stores under data/{market}/{frequency}/ and reference tables under data/reference/.

The factories snapshot their paths as plain strings, so a root override must be applied before the first factory call.

Examples#

>>> from quantlab.config import set_data_root, stock_kline_config
>>> set_data_root("/mnt/quant")
PosixPath('/mnt/quant')
>>> cfg = stock_kline_config(start_date="2020-01-01", symbols=("AAPL",))
>>> cfg.zarr_file_path
'/mnt/quant/data/us_equity/1d/stock.zarr'

Functions

get_data_root

Return the storage root every config factory derives its paths from.

set_data_root

Set the process-level storage root, ahead of the environment variable.

stock_kline_config

Build the DatasetConfig for daily US-equity bars.

universe_config

Build the UniverseConfig for the US-equity universe reference table.