Pynws
⛈️ A python library to asynchronously retrieve weather observation from NWS/NOAA
Install / Use
/learn @MatthewFlamm/PynwsREADME
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 |
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
