Skip to content

SDK installation

Terminal window
pip install mostlyright

Python 3.11 or newer. The wheel’s requires-python is >=3.11. Older versions are not supported.

Install these separately if you need them:

Terminal window
pip install pandas # for as_dataframe=True on observations/forecasts/pairs
pip install pyarrow # for format="parquet" responses

Neither is required for basic use. (The wheel itself pulls a small dependency tree via httpx.)

Two classes cover everything:

from mostlyright import MostlyRightClient # historical + climate + forecasts + pairs
from mostlyright import WeatherLive # real-time METAR, direct from AWC

TherminalClient is a drop-in alias for MostlyRightClient — kept for backward compatibility with earlier therminal-py users. Use MostlyRightClient in new code.

from mostlyright import MostlyRightClient
client = MostlyRightClient()
print(client.health())
# {"status": "ok", "version": "0.14.1", "stations": 20, "data_dir_exists": true}
stations = client.stations()
print(f"{len(stations)} stations available")

If you see AuthenticationError, your MOSTLYRIGHT_API_KEY env var isn’t set. See Authentication.

For AI agents, the SDK exposes its surface as a tools schema:

tools = client.as_tools()
# list of function schemas compatible with Claude, GPT function-calling, etc.
client.as_tools() → Anthropic tool definitions 4 tools
observations 4 params

Historical hourly station observations, point-in-time correct.

stationfrom_dateto_dateas_of
forecasts 3 params

NWS MOS and Open-Meteo forecasts for a station and window.

stationmodelissued_at
climate 3 params

Daily climate aggregates (min / max / mean / precip).

stationfrom_dateto_date
stations 0 params

List available stations with lat/lon and covered date ranges.

Pair it with the feature catalog for retrieval-aware prompts:

schema = client.feature_catalog()
# dict of every observation field, unit, type, physical bounds