Skip to content

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.

Terminal window
pip install mostlyrightmd

Python 3.11+. The import name is mostlyright.

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"])

Example output—the live values move; the historical row stays fixed:

live 2026-07-23T17:51:00Z 77.0 awc.live
historical 2025-01-15T23:51:00Z 28.0 iem

Both 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.

Each domain exposes methods for its own data:

  • weather.observations() and weather.forecasts() for weather inputs
  • economy.series() and economy.snapshot() for release vintages
  • markets.kalshi.* and markets.polymarket.* for venue data
  • finance.* for earnings transcripts and facts

Start with these methods when you need to choose the sources, date window, or joins.

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 date
from mostlyright import weather
example = weather.training_table(
"KNYC",
date(2025, 1, 6),
date(2025, 1, 12),
)
print(example.columns.tolist())

The result has one row per station and local-standard day. Important columns include:

  • decision_time_utc: the row’s cutoff
  • daily_summary_temp_high_f / daily_summary_temp_low_f: the official daily outcome
  • observed_temp_*: observation features
  • label_available_time_utc and knowable_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.