One contract for historical and live data.

Historical rows and current reports keep the same shared columns, units, null behavior, timestamps, and source fields. Move from research to production without rebuilding field mappings.

archive-and-live.py
1from mostlyright import weather
2
3live = await weather.live.latest("KNYC")
4archive = weather.observations(
5    "KNYC", "2025-01-15", "2025-01-15",
6    return_type="list",
7)[-1]

Change the time window, not your data model.

Historical and live reads preserve documented field meanings. Each mode can add its own timing or fetch metadata without renaming shared measurements.

One shared contract

Historical and live rows use the same names for event time, temperature, dewpoint, and source.

Source on every row

Each result retains the provider selected by source filtering or deterministic deduplication.

Clear time fields

event_time_utc states when the observation happened. Historical rows can add the station-local calendar day.

Cache by mutability

Completed historical periods can be reused. Current periods are refetched instead of treated as final.

Reuse historical data without freezing current periods

Python historical reads reuse Parquet partitions under ~/.mostlyright/cache/. Node uses ~/.mostlyright/cache-ts/; browsers use IndexedDB. Current periods are skipped or refetched so incomplete partitions are not treated as final.

Archive partitions: completed periods can be reused without treating the current period as final.
Source field: each observation row names the provider that produced it.
Fetch ledger: cache writes record source, station, window, fetch time, row count, and window hash.
weather example · ~/.mostlyright/cache
~/.mostlyright/cache/
├─ v1/observations/KNYC/2025/01.parquet
└─ provenance/iem.jsonl

import mostlyright as mr

reports = weather.observations(
    "KNYC", "2025-01-01", "2025-01-31", source="iem"
)
provenance = mr.provenance(reports)

What you stop rewriting when you switch to live data

Concern Direct provider integration Mostly Right
Historical and live maintain separate clients and payload models one shared data contract
Columns and units translate provider fields in application code documented names such as event_time_utc and temp_f
Source identity track provider metadata separately source kept on every returned row
Missing data decode provider sentinels and empty payloads explicit nulls and typed no-data errors

Research with historical data. Use the same contract live.

// contact

Talk to the team

Self-serve signup lives at app.mostlyright.md. This form is for everything it cannot do: procurement, invoicing, custom licensing, or anything you want to ask first. We reply by email.

I'm a

One email from the team. No spam.