quantlab.dataset.sharadar.tables#

The Sharadar raw tier: which tables exist, their columns and where they live.

The raw tier is Sharadar’s own rows, kept as parquet under <download-dir>/sharadar/<code>/, one directory per table. The acquisition layer writes it and the datasets read it; both take the table names, the column schemas and the directory layout from this module, so the writer and the reader cannot disagree. This module only reads; the writers of the watermarks, bulk-pull records and TICKERS history are in quantlab.acquisition.sharadar.raw_tier.

Each table has a short code, the lower-cased legacy Sharadar code (sep for stock prices), which names its directory, and an API name (stocks), which is what api.sharadar.com/v1.0 calls it. TICKERS’ table column uses the upper-case code in the bulk file (SEP) and the API name over REST (stocks). Column names and order are Sharadar’s published schema, verbatim (GET api.sharadar.com/v1.0/schema/<api name>, as of 2026-08-18), with the PostgreSQL types mapped to polars: text to String, date to Date, double precision to Float64 and bigint to Int64. A ticker is always String, so NA or 1234 is never read as a null or a number.

Examples#

>>> TABLES["sep"].api_name
'stocks'
>>> raw_table_dir("/data/downloads/sharadar", "sep")
PosixPath('/data/downloads/sharadar/sep')

Classes

SharadarTable

One Sharadar table of the raw tier.

Functions

bulk_file

Return the path of a table's bulk pull, <code>/<code>.parquet.

map_permatickers

Add each row's permaticker, refusing a missing or ambiguous one.

permaticker_mapping

Return the (ticker, permaticker) pairs TICKERS gives one table's rows.

pull_day

Return the Eastern date of a raw file's pull (pull_time, in VENDOR_TZ), the day its split basis stands on.

pull_time

Return when a raw file was pulled, in UTC.

raw_files

Return a table's raw parquet files: the bulk file, then its windows and updated pulls in pull order.

raw_table_dir

Return the directory holding one table's raw parquet.

raw_through

Return the last day every one of codes is complete through in the raw tier.

read_watermark

Return the day a table's raw tier is complete through, or None.

scan_raw_table

Scan one raw table: its bulk pull overlaid with its later pulls.

snapshot_for

Return the TICKERS snapshot of the run that pulled a file at pulled_at, or None.

split_basis_change

Return rows with _basis: the factor taking a split-adjusted value from one pull's basis to another's.

table

Return the table with this code.

tickers_history

Return the TICKERS history (fold_tickers_history), or None without one.

tickers_history_file

Return the path of the TICKERS history (TICKERS_HISTORY_FILE).

tickers_snapshot_file

Return the path of the TICKERS snapshot of a pull, beside tickers.parquet.

tickers_snapshots

Return the TICKERS snapshots, oldest first.

trading_days

Return SEP's trading days up to through, sorted, as ns datetimes named timestamp.

updated_file

Return the path a lastupdated pull of a table is written to.

vendor_today

Return today's date in Sharadar's time zone (VENDOR_TZ).

window_file

Return the path a date-window pull of a table is written to.

with_pull_day

Return annotate adding _pulled, the pull_day of each raw file, to its scan.