Skip to content

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"asyncdefexample():
asyncwithaiohttp.ClientSession() assession:
nws=pynws.SimpleNWS(*PHILLY, USERID, session)
awaitnws.set_station()
awaitnws.update_observation()
awaitnws.update_forecast()
awaitnws.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 typeknown NWS unitspynws unit
temperaturedegF, degCCelsius
pressurePaPascal
speedm_s-1, km_h-1km_h-1
percentpercentpercent
angledegree_(angle)degrees
distancemmeter

About

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

Resources

Stars

38 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages