quantlab.dataset.sharadar.stores.SharadarStore#
- class quantlab.dataset.sharadar.stores.SharadarStore(name, folder, description, config_cls, dataset_cls, fields=<factory>, raw_field='raw_data_dir_path', panel=False)[source]#
Bases:
objectOne Sharadar store: where it goes and how its dataset is built.
- Attributes:
- namestr
The store’s stem; the store is
<folder>/<name>/<name>.zarr.- folderPath
Its folder under the data root (
MARKET_FOLDERorUNIVERSE_FOLDER).- descriptionstr
What it holds, the first line of the README.md
build_storeswrites.- config_cls, dataset_clstype
The config and dataset classes that build it.
- fieldsMapping
The config fields beyond its paths and start date (a price store’s
table, a fundamentals store’sdimension).- raw_fieldstr, default “raw_data_dir_path”
The config field naming the raw tier (
cache_dirfor the membership).- panelbool, default False
Whether it is a filing, ownership, industry, fiscal-year, share-class or listing panel: built from SEP’s first day by
update_storeswhen missing.
Examples
>>> store("sharadar_sf1_arq").fields {'dimension': 'ARQ'}
- dataset(data_dir, download_dir, start=None)[source]#
The store’s dataset, reading the raw tier under
download_dir.- Parameters:
- data_dirstr or Path
The data root.
- download_dirstr or Path
The download root; the raw tier is its
sharadar/.- startstr or None, default None
The first day the store holds;
Noneis the whole history.
- Returns:
- BaseDataset
The dataset;
update()builds or extends the store.
Examples
>>> ds = store("sharadar_spy_1d").dataset("/data", "/data/downloads") >>> ds.config.permatickers, ds.config.raw_data_dir_path ((118691,), '/data/downloads/sharadar')