quantlab.acquisition.registry.refresh_raw_tier#
- quantlab.acquisition.registry.refresh_raw_tier(descriptor, download_dir, *, end=None, **options)[source]#
Keep a vendor’s raw tier current from its watermarks, in the current process.
Calls the refresh the vendor registered on its descriptor (
SourceDescriptor.raw_tier_refresh, aquantlab.acquisition.refresh.RawTierRefresh), so the caller names a vendor, never a client: Sharadar’s daily table plan, Massive’s REST endpoints, FRED’s series. It writes the raw tier only; the stores are brought up to date afterwards from it.This is the registry’s one way to keep a raw tier current (ADR 0049). A vendor whose download is symbol-batched serves it by wrapping its
SymbolBatchAcquisitionin its refresh, as FRED does; downloading an explicit roster over an explicit window isdownload_symbols().- Parameters:
- descriptorSourceDescriptor
The vendor to refresh.
- download_dirstr or Path
The download root; the vendor’s raw tier sits under it.
- enddate or None, default None
The last day to pull;
Noneis the vendor’s today.- **options
The vendor’s own settings, passed through (Sharadar’s
trading_days; Massive’sendpoints; FRED’sseriesandstart).
- Returns:
- RawTierRefreshResult
Every part tried, a failed one with its error.
- Raises:
- ValueError
If the vendor registered no refresh (Tiingo, Alpaca, WRDS).
Examples
Needs the vendor’s credential in the environment and network access:
from quantlab.acquisition.base import DataSourceRegistry from quantlab.acquisition.registry import refresh_raw_tier result = refresh_raw_tier(DataSourceRegistry.get("massive"), "/data/quantlab/downloads") result.failed # the endpoints not refreshed
A vendor without one is refused before anything is touched:
>>> from quantlab.acquisition.base import DataSourceRegistry >>> refresh_raw_tier(DataSourceRegistry.get("tiingo"), "downloads") Traceback (most recent call last): ... ValueError: Tiingo EOD registers no raw-tier refresh; download it with download_symbols().