Get started
Quickstart
Mostly Right returns historical and live public data with the same core fields, plus explicit sources and timestamps. Call a domain method directly, or use a built-in training-table example.
01 · Install
Section titled “01 · Install”pip install mostlyrightmdPython 3.11+. The import name is mostlyright.
pnpm add mostlyrightNode 20+. The package is ESM-first.
02 · Compare live with history
Section titled “02 · Compare live with history”Fetch the newest report from KNYC, the Central Park weather station in New York, beside a fixed historical day.
from mostlyright import weather
live = await weather.live.latest("KNYC")historical = weather.observations( "KNYC", "2025-01-15", "2025-01-15", return_type="list",)[-1]
for label, row in (("live", live), ("historical", historical)): print(label, row["event_time_utc"], row["temp_f"], row["source"])import { weather } from "mostlyright";
const live = await weather.latest("KNYC");const { rows: reports } = await weather.observations( "KNYC", "2025-01-15", "2025-01-15",);const historical = reports.at(-1);
console.log( "live", live.event_time_utc, live.temp_f?.toFixed(1), live.source,);console.log( "historical", historical?.event_time_utc, historical?.temp_f?.toFixed(1), historical?.source,);Example output—the live values move; the historical row stays fixed:
live 2026-07-23T17:51:00Z 77.0 awc.livehistorical 2025-01-15T23:51:00Z 28.0 iemBoth rows expose event_time_utc, temp_f, and source with the same meanings. Their values differ because the observations are eighteen months apart. Full rows retain raw_metar; historical rows also add local_standard_date, the station-local calendar day, and use the canonical ICAO station key (KNYC rather than the live AWC row’s NYC).
If the live source has no fresh report, the call raises NoLiveDataError instead of returning stale data.
03 · Explore another domain
Section titled “03 · Explore another domain”Each domain exposes methods for its own data:
weather.observations()andweather.forecasts()for weather inputseconomy.series()andeconomy.snapshot()for release vintagesmarkets.kalshi.*andmarkets.polymarket.*for venue datafinance.*for earnings transcripts and facts
Start with these methods when you need to choose the sources, date window, or joins.
04 · Try the training-table example
Section titled “04 · Try the training-table example”training_table() is a shortcut for one supervised-learning recipe. It selects
a built-in settlement target, rolls historical observations into daily
features, and keeps the cutoff fields visible. It does not add forecast
features.
from datetime import datefrom mostlyright import weather
example = weather.training_table( "KNYC", date(2025, 1, 6), date(2025, 1, 12),)print(example.columns.tolist())import { trainingTable } from "mostlyright";
const { rows: example } = await trainingTable( "KNYC", "2025-01-06", "2025-01-12",);console.log(Object.keys(example[0]));The result has one row per station and local-standard day. Important columns include:
decision_time_utc: the row’s cutoffdaily_summary_temp_high_f/daily_summary_temp_low_f: the official daily outcomeobserved_temp_*: observation featureslabel_available_time_utcandknowable_at_utc: timestamps used by the recipe
Use this helper when its built-in recipe matches your research. When you need a different target, source, feature window, forecast model, aggregation, or missing-data policy, use the direct domain reads and compose the table yourself.
See Build a point-in-time research table for custom joins, the built-in example, and the limits of the timing checks.