Skip to main content

ml-data-access

Read side of the malatium data store. One load_* per table that ml-data-pipelines writes, over a bear-lake database, in the shape of at-research's data helpers.

pip install ml-data-access
import datetime as dt

import ml_data_access

db = ml_data_access.connect()  # ML_DATA_STORE, or connect(path)
start, end = dt.date(2018, 7, 2), dt.date(2025, 6, 30)

reference_df = ml_data_access.load_reference_returns(db, start, end)
scores_df = ml_data_access.load_signals(db, "vrp", start, end)
loadings_df = ml_data_access.load_factor_loadings(db, start, end)
chain_df = ml_data_access.load_option_greeks(db, "AAPL", dt.date(2025, 1, 1), dt.date(2025, 3, 31))

Every loader is load_x(db, start=None, end=None) and returns a collected DataFrame for the inclusive window; the three per-symbol chain loaders take the symbol first. Nothing is screened, joined or derived: the store holds canonical tables (symbol is the option root, right is C/P, iv is null where the vendor's inversion failed, vega is per vol point).

The frames slot straight into malatium:

from malatium.providers import PanelProvider, TradingCalendar

calendar = TradingCalendar(ml_data_access.load_sessions(db, start, end))
reference = PanelProvider(reference_df)
scores = PanelProvider(scores_df)

Loaders

loader table
load_calendar, load_sessions exchange sessions, as a frame or a list of dates
load_universe point-in-time S&P 500 membership, ticker and symbol
load_sectors GICS sector snapshot
load_indices, load_yields, load_rates index levels (2024 on), the CBOE yield curve, SOFR
load_corporate_actions, load_earnings splits and dividends; announcement dates with a session
load_underlying EOD stock OHLCV, 2023-06 on
load_option_greeks(db, symbol, ...), load_index_greeks, load_open_interest one name's chain, index chain, open interest
load_symbology_check, usable_symbol_years which symbol-years are the right company
load_reference_returns the reference straddle's per-vega P&L, SPX included
load_factor_returns, load_factor_loadings, load_factor_covariances, load_idio_vol the vol risk model
load_surface, load_realized_vol, load_forecast, load_stock_features the derived panels
load_signals(db, name, ...) one signal's (date, symbol, score)
in_universe semi-join a (date, symbol) panel to membership

ml_data_access.describe() lists what the store holds. ml_data_access.scan(name, years, symbols) is the lazy scan under every loader; it opens only the partitions asked for, using bear-lake's <table>/<year>/<symbol>.parquet layout.

Things to know before trusting a number

  • Eighteen symbol-years are another company's chain. Semi-join against usable_symbol_years(db) for any multi-year study.
  • Open interest is one day stale by construction and joins on the same date.
  • iv is null, not wrong, on the ~3% of contract-days that failed to invert.
  • Repaired index sessions (mostly 2020-21) carry null gamma and a 15:59 underlying.

Development

uv sync
uv run pytest        # builds a synthetic store in a temp dir
uv run ruff check . && uv run ruff format .

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ml_data_access-0.1.0.tar.gz (61.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml_data_access-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file ml_data_access-0.1.0.tar.gz.

File metadata

  • Download URL: ml_data_access-0.1.0.tar.gz
  • Upload date:
  • Size: 61.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ml_data_access-0.1.0.tar.gz
Algorithm Hash digest
SHA256 418ec05f4ddadbd3af8f3e87d858241860f9bf80b2d3820b484a8343baacf2bc
MD5 759a07c50ae399d1b0280de89c6ddfbc
BLAKE2b-256 7b0dfdac417bf072c259115f9e0d936280a8afcb2b5fd61c00ab6915459ac0bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ml_data_access-0.1.0.tar.gz:

Publisher: publish.yml on Atium-Research/ml-data-access

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ml_data_access-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ml_data_access-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ml_data_access-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9019f72dc8c26ded3e68ec35a279252b66c9485cd542d36c2ee5792283971319
MD5 b60d277e10be3293b1807d2944b13c03
BLAKE2b-256 3e9c5759674b60372792b5bd19132ef05426c1b16c844868ff2f9199f70e3fe6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ml_data_access-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Atium-Research/ml-data-access

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page