Skip to main content

Python library to retrieve observations and forecasts from NWS/NOAA

Project description

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

Project details


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.1.0.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

pynws-2.1.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file pynws-2.1.0.tar.gz.

File metadata

  • Download URL: pynws-2.1.0.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pynws-2.1.0.tar.gz
Algorithm Hash digest
SHA256 4fcf8547ac6b202de9b201ed17849cf6d4efcb4af84650e37d6308eed97304d9
MD5 fd351b0b5d1f3b7ea30ad1bdba7e06fb
BLAKE2b-256 c25f08a5d813086fab7f1ab8e7d8979827c41785cde6c9342322778e83f61192

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynws-2.1.0.tar.gz:

Publisher: pythonpublish.yml on MatthewFlamm/pynws

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pynws-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: pynws-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pynws-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c21004f3d12a31b0ac121d228c2ced5b53d84ec326072c699de3487f4616a6e
MD5 8e48e62ab0b85cc668ce0fa69e910eba
BLAKE2b-256 f0950f0131838539b0786286f9000bfccc7424b7e164f2a221e7f456e5f58494

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynws-2.1.0-py3-none-any.whl:

Publisher: pythonpublish.yml on MatthewFlamm/pynws

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page