Skip to content

mostlyright.weather.stations

mostlyright.weather.stations — the canonical home for the station catalog.

Station, CATALOG, and StationCatalog live here rather than at the package root: a station is a weather fact, not root machinery. This module is the canonical public home that the root mostlyright.Station / mostlyright.CATALOG / mostlyright.StationCatalog shims delegate to (with a DeprecationWarning).

Split-distribution firewall: the catalog implementation stays in core (mostlyright.stations / mostlyright._internal._stations) so mostlyrightmd never gains a runtime dependency on mostlyrightmd-weather. This module re-exports that implementation in the weather direction (weather already depends on core), giving the symbols their canonical public home under mr.weather.stations without inverting the dependency graph.

CITIES / City / CityCatalog ride the same firewall: the city index is implemented in core (mostlyright._cities / mostlyright._internal._cities) and re-exported here, so CITIES.get("new_york") is the start-here discovery call beside the station catalog it indexes.

class mostlyright.weather.stations.City(key, name, country, stations, venue_stations)

Section titled “class mostlyright.weather.stations.City(key, name, country, stations, venue_stations)”

Bases: object

A city and the registry stations that observe it.

snake_case ASCII join key (e.g. "new_york").

Display name in its native spelling (e.g. "São Paulo").

ISO 3166-1 alpha-2 code, shared by all of the city’s stations.

ICAOs serving this city, sorted, at least one.

venue -> ICAOs for the stations that venue settles against, derived from Station.venues. A venue with no station in this city is absent, so an empty mapping means no prediction-market venue settles here.

class mostlyright.weather.stations.CityCatalog(cities=None)

Section titled “class mostlyright.weather.stations.CityCatalog(cities=None)”

Bases: object

Read-only city index over the station registry.

Lookups normalize their argument, so get("new_york"), get("New York") and get("new-york") all resolve to the same record.

  • Parameters: cities (Iterable [City ] | None)

Return cities whose ISO 3166-1 alpha-2 country matches, sorted by key.

Return cities with at least one station tagged venue, sorted by key.

Return the city for key (city key or display name).

  • Raises: KeyError – when no city matches.
  • Return type: City
  • Parameters: key (str)

Return the union of all venue tags present in the catalog.

alias of StationInfo

class mostlyright.weather.stations.StationCatalog(stations=None)

Section titled “class mostlyright.weather.stations.StationCatalog(stations=None)”

Bases: object

Read-only view over the station registry with venue/country filters.

Lookups accept either the registry key (3-letter NWS code for US stations, ICAO for international) or the 4-letter ICAO directly, so get("NYC"), get("KNYC"), and get("EGLL") all resolve.

  • Parameters: stations (dict [str , Station ] | None)

Return stations whose ISO 3166-1 alpha-2 country matches, sorted by ICAO.

  • Return type: list[StationInfo]
  • Parameters: country (str)

Return stations tagged with venue (e.g. "kalshi"), sorted by ICAO.

  • Return type: list[StationInfo]
  • Parameters: venue (str)

Return the station for code (registry key or ICAO).

  • Raises: KeyError – when no station matches.
  • Return type: StationInfo
  • Parameters: code (str)

Return the union of all venue tags present in the catalog.