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: object

One 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_FOLDER or UNIVERSE_FOLDER).

descriptionstr

What it holds, the first line of the README.md build_stores writes.

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’s dimension).

raw_fieldstr, default “raw_data_dir_path”

The config field naming the raw tier (cache_dir for 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_stores when 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; None is 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')
path(data_dir)[source]#

The store under the data root data_dir.

Examples

>>> store("sharadar_daily_1d").path(Path("/data")).as_posix()
'/data/market/sharadar/sharadar_daily_1d/sharadar_daily_1d.zarr'