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.
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]
1import { weather } from "mostlyright"; 2 3const live = await weather.latest("KNYC"); 4const { rows } = await weather.observations( 5 "KNYC", "2025-01-15", "2025-01-15" 6); 7const archive = rows.at(-1);
Historical and live reads preserve documented field meanings. Each mode can add its own timing or fetch metadata without renaming shared measurements.
Historical and live rows use the same names for event time, temperature, dewpoint, and source.
Each result retains the provider selected by source filtering or deterministic deduplication.
event_time_utc states when the observation happened. Historical rows can add the station-local calendar day.
Completed historical periods can be reused. Current periods are refetched instead of treated as final.
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.
~/.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)
| 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 |