Skip to main content

truewire-weather-gov

A typed, validated, async Python client for the US National Weather Service API: forecasts, hourly forecasts, the raw gridded data behind both, station observations, and every watch, warning and advisory in effect.

Generated by Truewire from a spec of what the API puts on the wire, and checked against recordings of real responses.

pip install truewire-weather-gov

No account, no key, no quota. The service asks one thing: say who you are in User-Agent. That is the contact argument, and it is required — a default would be a lie about who is calling.

Note: PyPI has an unrelated weather-gov package that also imports as weather_gov. The two cannot share an environment.

Use

Almost everything here is addressed by grid cell rather than by coordinates, so a caller starts at points.get_point:

import asyncio

from weather_gov import Weather


async def main() -> None:
  async with Weather.new(contact='you@example.com') as client:
    point = await client.points.get_point(latitude=47.6062, longitude=-122.3321)

    forecast = await client.forecast.get_forecast(
      office=point['gridId'], grid_x=point['gridX'], grid_y=point['gridY']
    )
    for period in forecast['periods'][:3]:
      print(period['name'], period['temperature'], period['temperatureUnit'], period['shortForecast'])


asyncio.run(main())

Every measurement carries its unit

This API never sends a bare number. A temperature is {'unitCode': 'wmoUnit:degC', 'value': 13, 'qualityControl': 'V'}, and value is None wherever the measurement is missing rather than zero — an airport station reports windGust only when there were gusts. The types say so, so the null is hard to forget.

Walking observations safely

stations.get_observations is paged by time, and the walk knows something hand-written code usually does not: the service caps a response at 500 observations and says nothing about the ones it withheld. A full page raises LogicError rather than letting the walk step past them.

Everything else

Eleven endpoints across six groups, three response vocabularies (GeoJSON, schema.org, JSON-LD) described as they actually arrive, and TypeScript and Rust clients from the same spec.

Full documentation, the spec, and the recordings: https://github.com/truewire-dev/weather-gov

MIT. NWS data is a work of the US government and is in the public domain.

Metadata

Release files for truewire-weather-gov 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for truewire-weather-gov 0.1.0
File Size Uploaded
truewire_weather_gov-0.1.0.tar.gz 28.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for truewire-weather-gov 0.1.0
File Interpreter ABI Platform
truewire_weather_gov-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.7 kB

Release files / truewire_weather_gov-0.1.0.tar.gz

Download URL truewire_weather_gov-0.1.0.tar.gz
Size 28.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a978603466d0509de770e25a572c303edb88abcfd119da89ce384f2d3b1bb8f5
BLAKE2b-256 checksum
How to use checksums
e0573f5fab2cadc472fc0153ebff1f0b4aa0435b633b0e32ca34044fb4bb510a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / truewire_weather_gov-0.1.0-py3-none-any.whl

Download URL truewire_weather_gov-0.1.0-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14d0489949e2ccf9aa20aea6955eb129d4008acf3d4fec0a753db1e951e82b9c
BLAKE2b-256 checksum
How to use checksums
fadac45a5961031b19d9d75e784aa29be1b2932b993a989beffdd764062c7273
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page