Reference
API reference
Mostly Right 2.0 groups methods by weather, markets, economy, and finance. Domain reads return source and timing fields. A small training-table helper covers a few predefined examples.
Python
Section titled “Python”import mostlyright as mr
mr.__all__# ['ContractError', 'LeakageError', 'MostlyrightError', 'NoDataError',# '__version__', 'discover', 'economy', 'finance', 'markets', 'weather']The four domains appear when their distributions are installed. A full pip install mostlyrightmd installs all four.
| Namespace | Stable starting points | What it covers |
|---|---|---|
mr.weather | observations(), climate(), forecasts(), satellite(), live.*, cwop.*, nwp.*, training_table() | Weather observations, forecasts, satellite pixels, citizen stations, labels, and live reports |
mr.economy | series(), snapshot(), releases(), training_table() | Economic indicators and first-print vintages |
mr.markets.kalshi | settlement_days(), parse_ticker(), training_table() | Kalshi weather-market labels and resolution rules |
mr.markets.polymarket | settlement_days(), discover(), settle(), training_table() | Polymarket discovery and settlement |
mr.markets.economy_trades | candles() | Kalshi economy-market price history |
mr.finance.transcripts | resolve(), derive(), transcript schemas, ledgers, and parsers | Earnings-call data and mention resolution |
mr.discover() | Cross-domain catalog search | Stations, schemas, and available data |
Raw observations and live reports
Section titled “Raw observations and live reports”Use observations() for archived per-report rows:
reports = weather.observations("KNYC", from_date, to_date)Use weather.live.latest() for the newest Python report:
import asyncio
now = asyncio.run(weather.live.latest("KNYC"))TypeScript exports the live method directly from weather:
const now = await weather.latest("KNYC");obs() was removed in 2.0. There is no compatibility alias.
Experimental composition
Section titled “Experimental composition”Custom join functions live under mostlyright.experimental, not at the package root:
from mostlyright.experimental import align, spine
target = spine( target_frame, entity="station", decision_time="decision_time_utc", y="label",)table = align(target, source_a, source_b)align(), spine(), DeferredSource, and the contributor registry are documented and usable, but semver-exempt until they graduate.
Training-table example
Section titled “Training-table example”weather.training_table() is a small predefined recipe used by the weather
quickstart. It returns one row per station and local-standard day, with the
official outcome beside observation features and cutoff fields.
from datetime import datefrom mostlyright import weather
example = weather.training_table( "KNYC", date(2025, 1, 6), date(2025, 1, 12),)The default label="cli" attaches NWS CLI daily-summary labels. Use
label="daily_extremes" for the international daily-extremes target.
The TypeScript meta package exposes the same example in camelCase:
import { trainingTable } from "mostlyright";
const { rows: example, provenance } = await trainingTable( "KNYC", "2025-01-06", "2025-01-12",);Python returns a DataFrame. TypeScript returns a DataResult with rows and
provenance. Serialized column names stay in snake_case across both SDKs. Use
the direct domain reads when this recipe does not fit.
2.0 naming changes
Section titled “2.0 naming changes”| Removed in 2.0 | Use now |
|---|---|
obs() | observations() |
pairs(), research(), dataset() | training_table() |
research_economy(), research_econ() | economy.training_table() |
economy.history() | economy.series() |
econ namespace | economy |
TypeScript dataset(), research(), pairs() | trainingTable() |
Complete API reference
Section titled “Complete API reference”This page is the short map. The generated references document every published module, function, option, return type, and exception:
See also
Section titled “See also”- Quickstart: compare direct historical and live reads
- Packages and versioning: install the full SDK or one domain
- Temporal safety: how decision cutoffs prevent leakage
- Errors: stable root errors and specialized exceptions