A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

wetterdienst

Trying to make access to weather data in Python feel like a warm summer breeze.
https://github.com/earthobservations/wetterdienst

Category: Atmosphere
Sub Category: Meteorological Observation and Forecast

Keywords

canada data deutscher-wetterdienst dwd eccc germany historical-data hydrology meteorology open-data open-source radar time-series uk united-states weather weather-api weather-forecast weather-station weatherservice

Keywords from Contributors

transformer measur projections archiving regrid composability earth-observation conversion generic productivity

Last synced: about 16 hours ago
JSON representation

Repository metadata

Open weather data for humans.

README.md

Wetterdienst - Open weather data for humans

"What do we want? Climate Justice! When do we want it? Now!" - FFF

[!WARNING]
This library is a work in progress!
Breaking changes should be expected until a 1.0 release, so version pinning is recommended.

Badges

CI

CI status
Documentation status
Code coverage

Meta

PyPI version
Conda version
Project license
Project status (alpha, beta, stable)
Python version compatibility

Downloads

PyPI downloads
Conda downloads

Citation

Citation reference

Overview

Welcome to Wetterdienst, your friendly weather service library for Python.

We are a group of like-minded people trying to make access to weather data in Python feel like a warm summer breeze,
similar to other projects like rdwd for the R language, which originally drew our
interest in this project. Our long-term goal is to provide access to multiple weather services as well as other related
agencies such as river measurements. With wetterdienst we try to use modern Python technologies all over the place.
The library is based on polars (we <3 pandas, it is still part of
some IO processes) across the board, uses uv for package administration and GitHub
Actions for all things CI. Our users are an important part of the development as we are not currently using the data we
are providing and only implement what we think would be the best. Therefore, contributions and feedback whether it be
data related or library related are very welcome! Just hand in a PR or Issue if you think we should include a new
feature or data source.

Data

For an overview of the data we have currently made available and under which license it is published take a look at the
data section. Detailed information on datasets and
parameters is given at the coverage
subsection. Licenses and usage requirements may differ for each provider so check this out before including the data in
your project to be sure that you fulfill copyright requirements!

For a closer look on the DWD data, you can use the interactive map
or the table provided by the rdwd package.

Features

  • APIs for stations and values
  • Get stations nearby a selected location
  • Define your request by arguments such as parameters, periods, start date, end date
  • Define general settings in Settings context
  • Command line interfaced
  • Web-API via FastAPI, hosted on wetterdienst.eobs.org
  • Rich UI features like explorer, stripes
  • Run SQL queries on the results
  • Export results to databases and other data sinks
  • Public Docker image
  • Interpolation and Summary of station values

Setup

Native

Via PyPi (standard):

pip install wetterdienst

Via Github (most recent):

pip install git+https://github.com/earthobservations/wetterdienst

There are some extras available for wetterdienst. Use them like:

pip install wetterdienst[sql]
  • cratedb: Install support for CrateDB.
  • docs: Install the Sphinx documentation generator.
  • duckdb: Install support for DuckDB.
  • export: Install openpyxl for Excel export and pyarrow for writing files in Feather- and Parquet-format.
  • influxdb: Install support for InfluxDB.
  • interpolation: Install support for station interpolation.
  • mysql: Install support for MySQL.
  • matplotlib: Install support for plotting (matplotlib), only used in radar examples.
  • plotting: Install support for plotting (plotly).
  • postgresql: Install support for PostgreSQL.
  • sql: Install DuckDB for querying data using SQL.

To check the installation, invoke:

wetterdienst --help

Docker

Docker images for each stable release will get pushed to GitHub Container Registry.

wetterdienst serves a full environment, including all the optional dependencies of Wetterdienst.

Pull the Docker image:

docker pull ghcr.io/earthobservations/wetterdienst

Library

Use the latest stable version of wetterdienst:

$ docker run -ti ghcr.io/earthobservations/wetterdienst
Python 3.8.5 (default, Sep 10 2020, 16:58:22)
[GCC 8.3.0] on linux
import wetterdienst
wetterdienst.__version__

Command line script

The wetterdienst command is also available:

# Make an alias to use it conveniently from your shell.
alias wetterdienst='docker run -ti ghcr.io/earthobservations/wetterdienst wetterdienst'

wetterdienst --help
wetterdienst --version
wetterdienst info

Raspberry Pi / LINUX ARM

Running wetterdienst on Raspberry Pi, you need to install numpy
and lxml prior to installing wetterdienst by running the following
lines:

# not all installations may be required to get lxml running
sudo apt-get install gfortran
sudo apt-get install libopenblas-base
sudo apt-get install libopenblas-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install python3-lxml

Additionally expanding the Swap to 2048 mb may be required and can be done via swap-file:

sudo nano /etc/dphys-swapfile

Thanks chr-sto for reporting back to us!

Example

Task

Get historical climate summary for two German stations between 1990 and 2020

Library

from wetterdienst import Settings
from wetterdienst.provider.dwd.observation import DwdObservationRequest

settings = Settings(  # default
  ts_shape="long",  # tidy data
  ts_humanize=True,  # humanized parameters
  ts_convert_units=True  # convert values to SI units
)

request = DwdObservationRequest(
  parameters=[
    ("daily", "climate_summary", "precipitation_height"),
  ],
  start_date="2002-08-11",  # if not given timezone defaulted to UTC
  end_date="2002-08-13",  # if not given timezone defaulted to UTC
  settings=settings
).filter_by_station_id(station_id=(5779,))

stations = request.df
stations.head()
# ┌────────────┬─────────────────┬────────────┬─────────────────────────┬───┬───────────┬────────┬──────────────────────┬─────────┐
# │ resolution ┆ dataset         ┆ station_id ┆ start_date              ┆ … ┆ longitude ┆ height ┆ name                 ┆ state   │
# │ ---        ┆ ---             ┆ ---        ┆ ---                     ┆   ┆ ---       ┆ ---    ┆ ---                  ┆ ---     │
# │ str        ┆ str             ┆ str        ┆ datetime[μs, UTC]       ┆   ┆ f64       ┆ f64    ┆ str                  ┆ str     │
# ╞════════════╪═════════════════╪════════════╪═════════════════════════╪═══╪═══════════╪════════╪══════════════════════╪═════════╡
# │ daily      ┆ climate_summary ┆ 05779      ┆ 1971-01-01 00:00:00 UTC ┆ … ┆ 13.7516   ┆ 877.0  ┆ Zinnwald-Georgenfeld ┆ Sachsen │
# └────────────┴─────────────────┴────────────┴─────────────────────────┴───┴───────────┴────────┴──────────────────────┴─────────┘

values = request.values.all().df
values.head()
# ┌────────────┬────────────┬─────────────────┬──────────────────────┬─────────────────────────┬───────┬─────────┐
# │ station_id ┆ resolution ┆ dataset         ┆ parameter            ┆ date                    ┆ value ┆ quality │
# │ ---        ┆ ---        ┆ ---             ┆ ---                  ┆ ---                     ┆ ---   ┆ ---     │
# │ str        ┆ str        ┆ str             ┆ str                  ┆ datetime[μs, UTC]       ┆ f64   ┆ f64     │
# ╞════════════╪════════════╪═════════════════╪══════════════════════╪═════════════════════════╪═══════╪═════════╡
# │ 05779      ┆ daily      ┆ climate_summary ┆ precipitation_height ┆ 2002-08-11 00:00:00 UTC ┆ 67.9  ┆ 10.0    │
# │ 05779      ┆ daily      ┆ climate_summary ┆ precipitation_height ┆ 2002-08-12 00:00:00 UTC ┆ 312.0 ┆ 10.0    │
# │ 05779      ┆ daily      ┆ climate_summary ┆ precipitation_height ┆ 2002-08-13 00:00:00 UTC ┆ 26.3  ┆ 10.0    │
# └────────────┴────────────┴─────────────────┴──────────────────────┴─────────────────────────┴───────┴─────────┘

# to get a pandas DataFrame and e.g. create some matplotlib plots    
values.to_pandas()

Client

# Get list of all stations for daily climate summary data in JSON format
wetterdienst stations --provider=dwd --network=observation --parameters=daily/kl --all

# Get daily climate summary data for specific stations
wetterdienst values --provider=dwd --network=observation --parameters=daily/kl --station=1048,4411

Other

Checkout examples for more examples.

Acknowledgements

We want to acknowledge all environmental agencies which provide their data open and free of charge first and foremost
for the sake of endless research possibilities.

We want to acknowledge all contributors for being part of the improvements to this library that make it better and
better every day.

Important Links

Supported by

JetBrains logo.

Special thanks to the kind people at JetBrains s.r.o. for supporting us with
excellent development tooling.

Citation (CITATION.cff)

---
cff-version: 1.2.0
type: software
title: wetterdienst
version: 0.60.0
date-released: '2023-09-16'
authors:
- name: Benjamin Gutzmann
- name: Andreas Motl
license: MIT
abstract: Open weather data for humans
keywords:
- open-source
- open-data
- weather
- weather-data
- weather-api
- weather-station
- time-series
- observations
- historical-data
- recent-data
- forecast
- radar
- dwd
- deutscher-wetterdienst
- german-weather-service
- mosmix
- radolan
- eccc
- environment-and-climate-change-canada
- environnement-et-changement-climatique-canada
- noaa
- national-oceanic-and-atmospheric-administration
- ghcn
- global-historical-climatology-network
- wsv
- Wasserstraßen-und-Schifffahrtsverwaltung-des-Bundes
- Federal-Waterways-and-Shipping-Administration
- ea
- environmental-agency-uk
- noaa-nws
- national-weather-service
- eaufrance-hubeau
- geosphere
- geosphere-austria
message: If you use this software, please cite it using these metadata.
...

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 6 days ago

Total Commits: 1,687
Total Committers: 27
Avg Commits per committer: 62.481
Development Distribution Score (DDS): 0.346

Commits in past year: 271
Committers in past year: 7
Avg Commits per committer in past year: 38.714
Development Distribution Score (DDS) in past year: 0.096

Name Email Commits
Benjamin Gutzmann g****n@g****m 1103
Andreas Motl a****l@p****g 367
dependabot[bot] 4****] 128
meteoDaniel d****6 22
Nico Neumann 3****o 12
Benjamin Gutzmann g****n@g****m 11
d.lassahn d****n@m****e 7
Rahul r****8@g****m 7
meteoDaniel d****n@g****m 5
Jan-Henrik Bruhn g****b@j****e 4
Berry Boessenkool b****b@g****e 2
Kai Mühlbauer k****r@u****e 2
Max Buchholz M****z@g****e 2
Niclas Hoyer i****o@n****e 2
Emmanuel Ferdman e****n@g****m 1
David Wallace d****e@t****e 1
Ilya Kamenshchikov i****v@g****m 1
Janek Nouvertné j****e@n****y 1
Justus Braun 5****n 1
Korbenga 7****a 1
Max Bachmann k****t@m****e 1
Maximilian Linhoff m****f@t****e 1
Weidav 6****v 1
Xylar Asay-Davis x****m@g****m 1
donni-h 5****h 1
e-dism 7****m 1
Sander Maijers 3****L 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 282
Total pull requests: 1,157
Average time to close issues: 2 months
Average time to close pull requests: 6 days
Total issue authors: 90
Total pull request authors: 24
Average comments per issue: 4.44
Average comments per pull request: 1.21
Merged pull request: 901
Bot issues: 0
Bot pull requests: 334

Past year issues: 39
Past year pull requests: 164
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 4 days
Past year issue authors: 24
Past year pull request authors: 6
Past year average comments per issue: 3.95
Past year average comments per pull request: 0.49
Past year merged pull request: 129
Past year bot issues: 0
Past year bot pull requests: 37

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/earthobservations/wetterdienst

Top Issue Authors

  • amotl (78)
  • gutzbenj (31)
  • meteoDaniel (23)
  • guidocioni (11)
  • larsrinn (9)
  • TheAnalystx (6)
  • SB-511 (6)
  • kmuehlbauer (5)
  • Weidav (4)
  • MLfreakPy (4)
  • saschnet (4)
  • Elfe (3)
  • e-dism (3)
  • wetterfrosch (3)
  • darian-heede (3)

Top Pull Request Authors

  • gutzbenj (607)
  • dependabot[bot] (334)
  • amotl (160)
  • meteoDaniel (18)
  • neumann-nico (10)
  • niclashoyer (3)
  • maxnoe (3)
  • Weidav (2)
  • kmuehlbauer (2)
  • bluearrow98 (2)
  • brry (2)
  • jhbruhn (2)
  • Korbenga (1)
  • maxbachmann (1)
  • MyPyDavid (1)

Top Issue Labels

  • enhancement (30)
  • bug (16)
  • feature (8)
  • help wanted (7)
  • infrastructure (6)
  • question (2)
  • parameter-naming (2)
  • tests (2)
  • good first issue (2)

Top Pull Request Labels

  • dependencies (334)
  • python (194)
  • github_actions (24)
  • enhancement (14)
  • feature (6)
  • infrastructure (5)
  • tests (4)
  • bug (3)
  • hacktoberfest-accepted (3)
  • docker (1)

Package metadata

pypi.org: wetterdienst

Open weather data for humans

  • Homepage: https://wetterdienst.readthedocs.io/
  • Documentation: https://wetterdienst.readthedocs.io/
  • Licenses: # MIT License Copyright (c) 2018 - 2024 earthobservations Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.107.0 (published about 1 month ago)
  • Last Synced: 2025-04-25T14:35:05.660Z (1 day ago)
  • Versions: 141
  • Dependent Packages: 2
  • Dependent Repositories: 5
  • Downloads: 12,428 Last month
  • Rankings:
    • Downloads: 2.515%
    • Stargazers count: 3.679%
    • Average: 5.288%
    • Forks count: 6.199%
    • Dependent repos count: 6.739%
    • Dependent packages count: 7.306%
  • Maintainers (1)
conda-forge.org: wetterdienst

  • Homepage: https://github.com/earthobservations/wetterdienst
  • Licenses: MIT
  • Latest release: 0.48.0 (published over 2 years ago)
  • Last Synced: 2025-04-25T14:35:11.967Z (1 day ago)
  • Versions: 43
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 23.459%
    • Forks count: 27.407%
    • Average: 34.017%
    • Dependent repos count: 34.025%
    • Dependent packages count: 51.175%

Dependencies

.github/workflows/coverage.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v3 composite
.github/workflows/dependency-review.yml actions
  • actions/checkout v3 composite
  • actions/dependency-review-action v3 composite
.github/workflows/docker-publish-full.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • docker/build-push-action v4 composite
  • docker/login-action v2 composite
  • docker/metadata-action v4 composite
  • docker/setup-buildx-action v2 composite
  • docker/setup-qemu-action v2 composite
.github/workflows/docker-publish-standard.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • docker/build-push-action v4 composite
  • docker/login-action v2 composite
  • docker/metadata-action v4 composite
  • docker/setup-buildx-action v2 composite
  • docker/setup-qemu-action v2 composite
.github/workflows/lint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/release/full/Dockerfile docker
  • debian bookworm-slim build
.github/release/standard/Dockerfile docker
  • python 3.11-slim-bookworm build
poetry.lock pypi
  • 287 dependencies
pyproject.toml pypi
  • Pint ^0.17
  • aenum ^3.0
  • aiohttp ^3.8.1
  • backports-datetime-fromisoformat ^2.0.0
  • beautifulsoup4 ^4.9
  • cachetools ^5.2
  • click ^8.0
  • click-params ^0.4.1
  • cloup ^3.0.1
  • crate ^0.30.1
  • dash ^2.8
  • dash-bootstrap-components ^1.4
  • dash-leaflet ^1.0.8
  • deprecation ^2.1
  • diskcache ^5.4.0
  • duckdb ^0.7.1
  • eccodes ^1.5.2
  • environs ^9.4.0
  • fastapi ^0.95.1
  • fsspec ^2023.01
  • geojson ^3.0.0
  • h5py ^3.1
  • httpx ^0.24.0
  • influxdb ^5.3
  • influxdb-client ^1.18
  • lxml ^4.9.1
  • matplotlib ^3.3
  • measurement ^3.2
  • mysqlclient ^2.0
  • numpy ^1.22
  • openpyxl ^3.0
  • pandas ^2.0
  • pdbufr ^0.10.2
  • platformdirs ^3.8
  • plotly ^5.11
  • polars ^0.16
  • psycopg2-binary ^2.8
  • pyarrow ^13.0
  • pypdf ^3.12.1
  • python ^3.9,<3.12
  • python-dateutil ^2.8.2
  • rapidfuzz ^3.1
  • requests ^2.20
  • scikit-learn ^1.0.2
  • scipy ^1.9
  • shapely ^2.0
  • sqlalchemy ^2.0
  • stamina ^23.1.0
  • tabulate ^0.8
  • timezonefinder ^6.1
  • tqdm ^4.47
  • tzdata ^2023.3
  • utm ^0.7
  • uvicorn ^0.14
  • wradlib ^1.19
  • xarray ^2023.1
  • xlsx2csv ^0.8.1
  • xlsxwriter ^3.0.9
  • xradar ^0.2.0
  • zarr ^2.13
wetterdienst/ui/streamlit/requirements.txt pypi
  • plotly *
  • wetterdienst *

Score: 18.720639725801995