Python library to retrieve observations and forecasts from NWS/NOAA
Project description
pynws
A python library to asynchronously retrieve weather observation from NWS/NOAA.
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 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pynws-2.0.0.tar.gz
(44.0 kB
view details)
Built Distribution
pynws-2.0.0-py3-none-any.whl
(16.8 kB
view details)
File details
Details for the file pynws-2.0.0.tar.gz
.
File metadata
- Download URL: pynws-2.0.0.tar.gz
- Upload date:
- Size: 44.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e263bcf6f2fb4c3493b0ec1f57c9ec679f3538f10f87cf1f8a8ea1e90934b5a |
|
MD5 | e876975f85beea85ddcb0a439cde0ca1 |
|
BLAKE2b-256 | 200c8d02d52fe4fbdb15c49b4718e1da4c0f71b69b0c8bb3cdd6282bd3928b0a |
File details
Details for the file pynws-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: pynws-2.0.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d2f1edc1348badf4bd12a08b59ecfeb542478e9ad291429d24db42cae254934 |
|
MD5 | 0127112cdf1055f63d25e30320d93667 |
|
BLAKE2b-256 | 1b3e8f69cc305e3e3b4bcf4131e874758d6d2f8a0fb50ba43ac020bb74097bf6 |