quantlab.dataset.sharadar.tickers.SharadarTickerLookup#

class quantlab.dataset.sharadar.tickers.SharadarTickerLookup(sidecar_path)[source]#

Bases: TickerLookup

The ticker and company a permaticker had on a day, from one <store>.sharadar_tickers.json.

The file is read on first use, so a lookup costs nothing until a name is asked for.

Parameters:
sidecar_pathstr or Path

The sidecar. SharadarStockDataset.ticker_lookup() builds one over its own.

Examples

>>> lookup = SharadarTickerLookup("/data/market/sharadar/sharadar_sep_1d/sharadar_sep_1d.zarr.sharadar_tickers.json")
>>> lookup.names([194817, 1], date(2022, 6, 9))
[SymbolName(ticker='META', company='META PLATFORMS INC'), SymbolName(ticker='1', company=None)]
names(symbols, day)[source]#

Return the ticker and company of each of symbols on day, in order.

Never raises: a symbol the sidecar does not know, or any symbol when the sidecar is missing or damaged, gets its own id as ticker.

Parameters:
symbolsSequence

Permatickers as on the panel’s symbol axis.

daydatetime.date

The date whose names to use; a span starts on its start.

Returns:
list of SymbolName

One name per input, in the input’s order.

Examples

>>> lookup.names([194817], date(2022, 6, 8))
[SymbolName(ticker='FB', company='FACEBOOK INC')]