quantlab.acquisition.sharadar.raw_tier.fold_tickers_history#

quantlab.acquisition.sharadar.raw_tier.fold_tickers_history(vendor_root)[source]#

Fold every TICKERS snapshot into the TICKERS history, and return its path.

The history holds one row per table, permaticker and ticker ever seen in a snapshot: TICKERS’ columns as of the latest snapshot holding it, plus first_seen and last_seen, the pull times (UTC) of the first and last. Folding is idempotent and keeps what earlier folds saw, so a snapshot pruned after it is folded (prune_tickers_snapshots) loses nothing. Every bulk pull folds before it prunes. Read back by quantlab.dataset.sharadar.tables.tickers_history.

Parameters:
vendor_rootstr or Path

<download-dir>/sharadar.

Returns:
Path or None

The history (tickers_history_file), or None when there is no snapshot and no history, and nothing was written.

Examples

Needs the Sharadar raw tier:

fold_tickers_history("/data/downloads/sharadar")
# PosixPath('/data/downloads/sharadar/tickers/_history.parquet')