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.
The domain map
Section titled “The domain map”| Namespace | What it covers | Guide |
|---|---|---|
mr.weather | Observations, forecasts, satellite, climate, settlement-day helpers | Weather observations |
mr.econ | Economic indicators with ALFRED vintages, releases, snapshots | Economic indicators |
mr.markets | Kalshi and Polymarket surfaces, econ-market trade history | Prediction markets |
mr.align, mr.spine | Compose sources onto a decision calendar, leakage-guarded | Compose a dataset |
mr.LeakageError, mr.ContractError, mr.NoDataError | The root exceptions, importable one deep | Errors |
The pairs family
Section titled “The pairs family”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.
Compose: align and spine
Section titled “Compose: align and spine”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.
Source families by name
Section titled “Source families by name”The map, not the manual. Each family carries its own signatures, schemas, and QC rules in the full reference.
| Domain | Families |
|---|---|
weather | obs, forecasts, satellite, climate, days, live, the label registry |
econ | series, releases, history, snapshot |
markets | kalshi, polymarket, econ_trades |
The full reference
Section titled “The full reference”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.
See also
Section titled “See also”- Quickstart: first call in four lines
- Packages & versioning: the distributions and how they move
- Observation schema: the frame every source returns
- Errors: the typed-error catalog