quantlab.dataset.sharadar.stores.update_stores#
- quantlab.dataset.sharadar.stores.update_stores(download_dir, data_dir, *, rebuild_dropped=False, keep_dropped=(), stores=None, today=None)[source]#
Bring the stores up to date from the raw tier, one store at a time.
Each existing store runs
update()from the first day it already holds: new bars are appended and earlier rows are never rewritten. A panel store not built yet is built from the SEP store’s first day, beside a README.md and acomponent.json. A store that fails does not stop the others: its error is logged and recorded, and its state isFAILED.A store refusing to resume (
ResumeRefused: a stored symbol left the raw tier’s symbol axis, or the store and its ledger disagree) is rebuilt from the raw tier withrebuild_dropped: the old store and its ledger are kept beside it as<store>.pre<YYYYMMDD>, and the result records the symbols removed and added.- Parameters:
- download_dirstr or Path
The download root holding the raw tier (
sharadar/).- data_dirstr or Path
The data root holding the stores.
- rebuild_droppedbool, default False
Whether to rebuild a store refusing to resume.
- keep_droppediterable of str, default ()
Store names (
sharadar_insiders_1d) never rebuilt: they refuse and keep their history.- storesiterable of str or None, default None
The names of the stores to update; every store when omitted.
- todaydate or None, default None
The day in a kept store’s
.pre<YYYYMMDD>suffix; the system clock’s when omitted.
- Returns:
- StoreUpdate
One
StoreResultper store: updated, built, rebuilt or failed.
Examples
Needs the stores of a first download and a refreshed raw tier:
outcome = update_stores("/data/quantlab/downloads", "/data/quantlab", rebuild_dropped=True, keep_dropped=["sharadar_insiders_1d"]) outcome.failed # ()