Skip to content

Reference

API surface

The whole SDK hangs off one import: three data domains, two composition verbs, three exceptions. This page is the public map with the signatures you compose with; the full per-module reference ships with access.

import mostlyright as mr
mr.__all__
# ['ContractError', 'LeakageError', 'NoDataError', '__version__',
# 'align', 'econ', 'markets', 'spine', 'weather']

That list is the curated root as of 1.18: everything else lives one level down, inside the domain it belongs to.

NamespaceWhat it coversGuide
mr.weatherObservations, forecasts, satellite, climate, settlement-day helpersWeather observations
mr.econEconomic indicators with ALFRED vintages, releases, snapshotsEconomic indicators
mr.marketsKalshi and Polymarket surfaces, econ-market trade historyPrediction markets
mr.align, mr.spineCompose sources onto a decision calendar, leakage-guardedCompose a dataset
mr.LeakageError, mr.ContractError, mr.NoDataErrorThe root exceptions, importable one deepErrors

Every domain answers the same question the same way: pairs(entity, from_date, to_date) returns a supervised frame, features on one side, the settled label on the other, keyed by entity and decision time.

weather.pairs(entity, from_date, to_date, label="cli")
econ.pairs(entity, from_date, to_date, as_of=None, source=None)
kalshi.pairs(entity, from_date, to_date, outcome=False, include_trades=False)
polymarket.pairs(entity, from_date, to_date, outcome=False, event=None)

Signatures abridged: type annotations and pass-through kwargs are stripped here and documented in the full reference. weather.pairs takes a station or list of stations and a label from the label registry; the markets variants take a venue ticker, and outcome=True appends the settled result.

mr.spine(df, entity=..., decision_time=..., y=..., label_available_time=None)
mr.align(spine, *sources)

spine lifts your own frame into a decision calendar; align joins sources onto it and raises LeakageError rather than let a row from the future through. A source called without dates (weather.obs("KNYC")) is a lazy spec that align materializes over the spine’s own window; see Compose a dataset for the grammar.

The map, not the manual. Each family carries its own signatures, schemas, and QC rules in the full reference.

DomainFamilies
weatherobs, forecasts, satellite, climate, days, live, the label registry
econseries, releases, history, snapshot
marketskalshi, polymarket, econ_trades

The complete per-module reference, every signature, schema, error subclass, and QC rule, is generated from source on each release and ships with SDK access. Request access and we will get you set up.