skillfed

pynws

Python library to retrieve observations and forecasts from NWS/NOAA

pynws v2.1.0 75.6K downloads/30d#14,695 on PyPI38
Permissive license MIT Active released

What it is and what it does

pynws is a Python library that wraps the National Weather Service (NWS/NOAA) API to retrieve weather data asynchronously. It provides two main interfaces: a lower-level `Nws` class for minimally processed data and a higher-level `SimpleNWS` class that adds data caching and unit normalization. The library converts NWS observations into standardized units (Celsius for temperature, Pascal for pressure, km_h-1 for wind speed, etc.) and allows you to fetch current observations, forecasts, and weather alerts for a specific geographic location.

The package depends on aiohttp for HTTP requests, yarl for URL handling, and metar for parsing meteorological data. It targets modern Python (3.9+) and is actively maintained. With low install friction and no known vulnerabilities, it is straightforward to integrate into weather-aware applications.

Use it for:

  • Build a weather dashboard or home automation system that polls NWS for current conditions and alerts.
  • Integrate real-time weather forecasts into a mobile or web app without managing your own weather data.
  • Monitor weather alerts for a specific forecast zone to trigger notifications or automated responses.
  • Retrieve standardized meteorological observations for data analysis or logging.
  • Create a weather-aware scheduling system that adjusts plans based on NWS forecasts.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Asynchronously fetch weather observations, forecasts, and alerts from the National Weather Service (NWS/NOAA) API for a given location.

Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a specific problem (async NWS data retrieval) with a clean API. It is suitable for weather-aware applications, home automation, and data collection. No known security vulnerabilities indicate reliable use.

Install

pynws on PyPI

pip

pip install pynws

uv

uv add pynws

poetry

poetry add pynws

Installing pynws

Before you install

Low install friction with pure Python wheels. Actively maintained with a recent commit (2026-08-03) and steady release cadence. Supports current Python versions (3.9–3.13).

License in practice

MIT license permits commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

import aiohttp
import pynws

async def get_weather():
    async with aiohttp.ClientSession() as session:
        nws = pynws.SimpleNWS(39.95, -75.16, "user@example.com", session)
        await nws.set_station()
        await nws.update_observation()
        print(nws.observation)

Requires an async context (asyncio event loop) and a valid user-agent string (email) for NWS API requests.

Verify before relying

  • Whether SimpleNWS caching behavior and update frequency are documented or configurable.
  • Rate limits or throttling behavior when making repeated NWS API calls.
  • Availability of detailed error handling or retry logic for network failures.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — aiohttp, metar, yarl
Maintenance actively maintained — 477 days since the last release
Last repo commit
First released
Downloads 75,626/month — #14,695 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pynws-2.1.0-py3-none-any.whl

Keywords: nws, weather

Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

NWS NOAA weather API clientasync weather observationsnational weather service pythonweather forecast retrievalNOAA weather data libraryreal-time weather observationsweather alerts and forecasts
weather-apiasync-httpnoaa

More Internet packages