Skip to content

Stormlore

Stormlore is the Python SDK for wxchange: forecasts at a place, along a route or over an area, returned as results that turn themselves into pandas DataFrames and xarray Datasets.

pip install stormlore            # client + pandas
pip install 'stormlore[xarray]'  # + AreaResult.to_xarray()
pip install 'stormlore[viz]'     # + charts and maps (.plot())
pip install 'stormlore[all]'     # everything

Python 3.10 or newer.

Five lines

from stormlore import Client

client = Client()  # reads WXCHANGE_API_KEY
now = client.forecast.point("gfs", (41.26, -95.94), ["temperature_2m"])
now.to_dataframe()

With no time given, the query asks for the forecast valid nearest to now, from the newest run. Values come back as the API serves them (here kelvin); see units.

Sync or async

Client blocks; AsyncClient is the same client with await:

from stormlore import AsyncClient

async with AsyncClient() as client:
    now = await client.forecast.point("gfs", (41.26, -95.94), ["temperature_2m"])

Both are built from one implementation, so they take the same arguments and return the same results.

Where next