quantlab.acquisition.base.Capability#
- class quantlab.acquisition.base.Capability(market, frequency, data_type=None, earliest_available=None, entitlement=None, dataset_cls=None, symbol_batch_cls=None, config_factory=None)[source]#
Bases:
objectOne
(market, frequency, data_type)combination a vendor serves.A descriptor lists its capabilities one by one rather than as every pairing of its markets and frequencies, because vendors serve irregular combinations. For example, Alpaca serves tick data for US equities only, and splits it into quotes and trades. Anything that differs between combinations, such as the earliest available date or the dataset class that converts the data, is stored here rather than on the descriptor. The class is frozen; extend it by adding optional fields.
- Parameters:
- marketMarket
The market, for example
"us_equity".- frequencyFrequency
The bar frequency, for example
"1d"or"tick".- data_typestr or None, default None
"bars","quotes","trades"and so on, orNonewhen the vendor makes no such distinction.Nonemeans “no data type”, not “any data type”.- earliest_availablestr or None, default None
ISO date of the earliest data the vendor serves, when known. It is informational; nothing checks against it.
- entitlementstr or None, default None
The subscription this capability needs, when the vendor sells several.
- dataset_clstype[MarketDataset] or None, default None
The dataset class that converts this capability’s raw tier into Zarr, or
Nonewhen no dataset can hold the data. Tick data, for example, arrives at irregular times and does not fit a regular(timestamp, symbol)grid.convert()refuses a capability whosedataset_clsisNone, so adding a conversion means filling this field, not adding a branch toconvert().- symbol_batch_clstype[SymbolBatchAcquisition] or None, default None
The class that downloads this capability, or
Noneto use the descriptor’s ownsymbol_batch_cls. One vendor account can serve several products through different classes; WRDS, for example, serves both TAQ quote data and CRSP daily data.- config_factorycallable or None, default None
The function that builds an
AcquisitionConfigfor this capability, orNoneto use the descriptor’s ownconfig_factory.
Notes
The class fields are direct class references, never dotted import paths. They are annotated with the abstract base classes so that the top of this module imports no vendor module.
Examples
>>> from quantlab.acquisition.base import Capability >>> cap = Capability(market="us_equity", frequency="1d", data_type="bars") >>> cap.data_type 'bars' >>> cap.dataset_cls is None True