Skip to content

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.

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.

NamespaceStable starting pointsWhat it covers
mr.weatherobservations(), climate(), forecasts(), satellite(), live.*, cwop.*, nwp.*, training_table()Weather observations, forecasts, satellite pixels, citizen stations, labels, and live reports
mr.economyseries(), snapshot(), releases(), training_table()Economic indicators and first-print vintages
mr.markets.kalshisettlement_days(), parse_ticker(), training_table()Kalshi weather-market labels and resolution rules
mr.markets.polymarketsettlement_days(), discover(), settle(), training_table()Polymarket discovery and settlement
mr.markets.economy_tradescandles()Kalshi economy-market price history
mr.finance.transcriptsresolve(), derive(), transcript schemas, ledgers, and parsersEarnings-call data and mention resolution
mr.discover()Cross-domain catalog searchStations, schemas, and available data

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.

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.

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 date
from 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.

Removed in 2.0Use now
obs()observations()
pairs(), research(), dataset()training_table()
research_economy(), research_econ()economy.training_table()
economy.history()economy.series()
econ namespaceeconomy
TypeScript dataset(), research(), pairs()trainingTable()

This page is the short map. The generated references document every published module, function, option, return type, and exception: