Skip to main content

Grab publicly available weather data

Project description

riweather

Tests Codecov Release

Grab publicly available weather data with riweather. See the full documentation.

Installation

Install with pip:

pip install riweather

To create interactive maps of weather station locations, install the package along with its optional dependencies:

pip install riweather[plots]

Usage

Given a latitude and longitude, get a list of weather stations sorted from nearest to farthest from that location.

>>> import riweather
>>> station_rank = riweather.rank_stations(39.98, -105.13, max_distance_m=20000)

Select the top station (or a different station):

>>> station = riweather.select_station(station_rank, rank=0)

View information about that station:

>>> station.name, station.usaf_id
('ERIE MUNICIPAL AIRPORT', '720534')

And pull weather data from that station for a certain year.

>>> station.fetch_data(2024, "air_temperature", period="h", temp_scale="F", tz="US/Mountain")
                           air_temperature.temperature_f
2023-12-31 18:00:00-07:00                      33.176848
2023-12-31 19:00:00-07:00                      29.726000
2023-12-31 20:00:00-07:00                      25.415750
2023-12-31 21:00:00-07:00                      22.736750
2023-12-31 22:00:00-07:00                      20.876750
...                                                  ...
2024-12-31 13:00:00-07:00                      34.328000
2024-12-31 14:00:00-07:00                      35.445500
2024-12-31 15:00:00-07:00                      35.640500
2024-12-31 16:00:00-07:00                      34.249250
2024-12-31 17:00:00-07:00                      31.057455
[8784 rows x 1 columns]

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

riweather-1.0.2.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

riweather-1.0.2-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file riweather-1.0.2.tar.gz.

File metadata

  • Download URL: riweather-1.0.2.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for riweather-1.0.2.tar.gz
Algorithm Hash digest
SHA256 dff3dfaa2dda660d644e44324e04eab97cc320e9f67dc46620bf4adfabdc730d
MD5 67a686c8ca186c5abdcd9c46ef01ba58
BLAKE2b-256 13bf2212f41c062e5ae3084c1c867e40fbf3898962797ed7349312978b1d00ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for riweather-1.0.2.tar.gz:

Publisher: release.yml on ensley-nexant/riweather

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

File details

Details for the file riweather-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: riweather-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for riweather-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 83454bd23742c0e73383f51b6feed52ed8a4b9251a15db53254b6465bb310b0f
MD5 39fcdba33a8cb20d5d5e4dcf82e2deab
BLAKE2b-256 92538786ce6bc2b5cb0b464bedf05312c039a0b834f41ee5d4a67d3f9f56f4c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for riweather-1.0.2-py3-none-any.whl:

Publisher: release.yml on ensley-nexant/riweather

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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page