quantlab.dataset.sharadar.tables.SharadarTable#

class quantlab.dataset.sharadar.tables.SharadarTable(code, api_name, schema, categories=None, primary_key=None, tickers_code=None)[source]#

Bases: object

One Sharadar table of the raw tier.

Attributes:
codestr

Lower-cased legacy code; the name of the table’s raw directory.

api_namestr

The table’s name on api.sharadar.com/v1.0.

schemadict of str to polars.DataType

The columns in the vendor’s order, with their types.

categoriestuple of str or None

For a table converted to a panel, the TICKERS category values an unrostered universe keeps by default; None keeps every category.

primary_keytuple of str or None

The vendor’s primary key, for a table refreshed by lastupdated (see updated_file): an updated row replaces the earlier row with the same key. None for a table that is never refreshed that way.

tickers_codestr or None

The code of the table whose TICKERS rows map this table’s tickers, for a table TICKERS has no rows of (DAILY covers SF1’s filers); None maps through the table’s own rows.

property mapping_labels#

Return the TICKERS table values whose rows map this table’s tickers.

The table’s own labels (tickers_labels), or, for a table TICKERS has no rows of (tickers_code), those of the table it is mapped through.

Examples

>>> TABLES["sep"].mapping_labels
('SEP', 'stocks')
>>> TABLES["daily"].mapping_labels
('SF1', 'fundamentals')
property tickers_labels#

Return the values TICKERS’ table column gives this table’s rows.

The bulk TICKERS file uses the upper-case legacy code (SEP), the REST API the API name (stocks); both are accepted. INDICATORS’ table column labels a table the same way.

Examples

>>> TABLES["sep"].tickers_labels
('SEP', 'stocks')