Skip to content

⛈️ A python library to asynchronously retrieve weather observation from NWS/NOAA

License

Notifications You must be signed in to change notification settings

MatthewFlamm/pynws

Folders and files

NameName
Last commit message
Last commit date
May 7, 2024
Dec 13, 2024
Feb 4, 2025
Sep 3, 2024
Feb 24, 2019
Apr 25, 2024
Apr 29, 2024
Mar 4, 2025
Nov 15, 2021
Jul 17, 2019
Aug 24, 2020
Jul 18, 2020
Nov 6, 2024
Feb 4, 2025

Repository files navigation

pynws

A python library to asynchronously retrieve weather observation from NWS/NOAA.

PyPI - Downloads

Example

See example.py for a runnable example.

PHILLY = (39.95, -75.16)
USERID = "testing@address.xyz"

async def example():
    async with aiohttp.ClientSession() as session:
        nws = pynws.SimpleNWS(*PHILLY, USERID, session)
        await nws.set_station()
        await nws.update_observation()
        await nws.update_forecast()
        await nws.update_alerts_forecast_zone()
        print(nws.observation)
        print(nws.forecast[0])
        print(nws.alerts_forecast_zone)

Functionality

pynws exposes the ability to retrieve raw data using raw_data module. Nws class offers ability to retrieve minimally processed data for a single location. SimpleNWS class offers data caching and several other helpers for interpreting output.

Units for Observations in SimpleNWS

NWS API does not expose all possible units for observations. Known units are converted to the following:

unit type known NWS units pynws unit
temperature degF, degC Celsius
pressure Pa Pascal
speed m_s-1, km_h-1 km_h-1
percent percent percent
angle degree_(angle) degrees
distance m meter

About

⛈️ A python library to asynchronously retrieve weather observation from NWS/NOAA

Resources

License

Stars

Watchers

Forks

Packages

No packages published