quantlab.dataset.massive.rest_panel.MassiveRestPanel#
- class quantlab.dataset.massive.rest_panel.MassiveRestPanel[source]#
Bases:
objectMixin of a Sharadar panel built from Massive’s REST records placed through the Ticker map.
Put it before the panel’s base class (
ReleasePanelDatasetor a subclass) and setREST_ENDPOINTS. The config is aMassiveRestPanelConfig.Examples
MassiveDisclosureDatasetis one:class MassiveDisclosureDataset(MassiveRestPanel, FilingPanelDataset): REST_ENDPOINTS = ("8k_disclosures",)
- EARLIEST = datetime.date(1970, 1, 1)#
The latest first day of those endpoints (their
RestEndpoint.earliest): a first build starts no earlier. Declared here because the dataset layer comes before acquisition; a test locks it toENDPOINTS.
- REST_ENDPOINTS = ()#
The REST endpoints read (
quantlab.acquisition.massive.rest.ENDPOINTS); the store is built only through the day each one is pulled through.
- STORE_NAME = ''#
The store folder’s name under
STORE_AREA, and its store’s stem.
- STORE_README = ''#
The folder’s
README.md, written by a first build when there is none.
- classmethod from_data_root(data_dir, download_dir)[source]#
Return the panel of its store folder under
data_dir, writing the folder on the first call.A folder holding
component.jsonis rebuilt from it. Otherwise the config is built on the shared layout: the store<data_dir>/market/massive/<STORE_NAME>/<STORE_NAME>.zarr, Sharadar’s raw tier<download_dir>/sharadar, Massive’s<download_dir>/massive, the Ticker map<data_dir>/market/massive/massive_ticker_map/massive_ticker_map, from the later of the map’s first day andEARLIEST, with no end;component.jsonis written, andSTORE_READMEwhen the folder has noREADME.md. Nothing is read from or written to the store itself:update()builds it.- Parameters:
- data_dirstr or pathlib.Path
The data root.
- download_dirstr or pathlib.Path
The download root, holding
sharadar/andmassive/.
- Returns:
- MassiveRestPanel
The panel, ready to
update().
- Raises:
- ValueError
If the folder has no
component.jsonand the Ticker map maps no day (namingticker_map.py); nothing is written then.
Examples
Needs the raw tiers and the Ticker map under the two roots, so it is not run here:
ds = MassiveShortVolumeDataset.from_data_root("/data/quantlab", "/data/quantlab/downloads") ds.update().store_path # '/data/quantlab/market/massive/massive_short_volume_1d/massive_short_volume_1d.zarr'
- property ticker_map#
The Ticker map the records are placed through.
Examples
With
configaMassiveDividendsConfig:MassiveDividendDataset(config).ticker_map.path.name # 'massive_ticker_map'
- property unplaced_path#
The report of the records left out (
<store>.unplaced.json).Examples
With
configaMassiveDividendsConfigof the storemassive_dividends_1d.zarr:MassiveDividendDataset(config).unplaced_path # '.../massive_dividends_1d.zarr.unplaced.json'