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.0rc0.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.0rc0-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file riweather-1.0.0rc0.tar.gz.

File metadata

  • Download URL: riweather-1.0.0rc0.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.0rc0.tar.gz
Algorithm Hash digest
SHA256 2dd2f8ec2bf488a3932bc3469845ef35f591058cc9e3cdb251a790a819b87a79
MD5 5b623b6212c92884054448d0eb3f3ef0
BLAKE2b-256 19b9464dea3037aadd09914e13c88ac269210a5ff578abe2dcc29e34ea9886f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for riweather-1.0.0rc0.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.0rc0-py3-none-any.whl.

File metadata

  • Download URL: riweather-1.0.0rc0-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.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8c8f789125e1ec0e03b9c0d9373244734226551d51919fec16d97d722573341
MD5 1c3e7b7cbbbeaba714ed312e0eec7565
BLAKE2b-256 1cbce6b47901b7fd5972b0e04ea16ac4b12d86fbd6b875a6110b6ed61ca81068

See more details on using hashes here.

Provenance

The following attestation bundles were made for riweather-1.0.0rc0-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