Download data from DWD's ftp server and return it as xarray DataArray
Project description
German Weather Service (DWD) Open Data Client
A Python library for downloading and processing meteorological data from the German Weather Service (Deutscher Wetterdienst - DWD) open data platform.
Features
- Load data from multiple stations and variables into xarray DataArrays
- Station mapping functionality to identify which stations provide specific variables
- Automatic handling of DWD data structure idiosyncrasies
Installation
This project uses uv for package management. If you don't have uv installed, follow the installation instructions.
From source
Clone the repository and install with uv:
git clone https://github.com/yourusername/dwd_opendata_client.git
cd dwd_opendata_client
uv sync
Development installation
To install with development dependencies:
uv sync --all-extras
Key Dependencies
- xarray - For handling multi-dimensional meteorological data
- pandas - Data processing and manipulation
- cartopy - Mapping and geospatial visualization
All dependencies are managed by uv and will be installed automatically
with uv sync.
Usage
Find stations that offer a set of variables within a bounding box and time frame:
import dwd_opendata as dwd
from datetime import datetime
start = datetime(1980, 1, 1)
end = datetime(2016, 12, 31)
variables = ("wind", "air_temperature", "sun", "precipitation")
fig, ax = dwd.map_stations(
variables,
lon_min=7,
lat_min=47.4,
lon_max=12.0,
lat_max=49.0,
start=start,
end=end,
)
Download data for multiple stations and variables at once and load as an
xarray.DataArray:
data = dwd.load_data(
("Konstanz", "Feldberg/Schwarzwald"),
variables=variables,
start_year=start,
end_year=end,
)
Data Directory
By default, data is stored in ~/.local/share/opendata_dwd (following
XDG Base Directory specification). You can override this by setting the
XDG_DATA_HOME environment variable.
CI/CD and Publishing
The project uses GitHub Actions to automatically build wheels on pushes to main and publish to PyPI when a version tag is created.
Releasing a New Version
To release a new version:
- Update the version in
pyproject.toml - Update the relevant section in
CHANGELOG.mdwith release notes - Create a git tag:
git tag vX.Y.Z - Push the tag:
git push origin vX.Y.Z
The GitHub Actions workflow will automatically:
- Build wheels
- Create a GitHub Release with the changelog excerpt
- Publish the wheels to PyPI
Building Locally
To build wheels locally using uv:
uv build
The wheels will be created in the dist/ directory.
Testing Releases on TestPyPI
Before releasing to production PyPI, you can test the publishing workflow on TestPyPI:
- Create a test tag:
git tag vX.Y.Z-test - Push the tag:
git push origin vX.Y.Z-test - Monitor the workflow at https://github.com/iskur/dwd_opendata/actions
- Verify the release on https://test.pypi.org/project/dwd_opendata/
- Test installation:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ dwd_opendata
Once verified, create the production release tag without the -test
suffix.
Status
⚠️ Experimental: This library is under active development and the API is not stable yet.
License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Acknowledgments
Data provided by Deutscher Wetterdienst (DWD) - German Weather Service
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dwd_opendata-0.1.0.tar.gz.
File metadata
- Download URL: dwd_opendata-0.1.0.tar.gz
- Upload date:
- Size: 819.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab572394e33d7e58ffcbb38ad8365320878849021718637cd7fb806d0cf1bb6c
|
|
| MD5 |
7cc9cea376736f8f2abda0f935cfb0a5
|
|
| BLAKE2b-256 |
a198c0ae7d0e954e293a475e08119da33e12f922e1e7032456a41ccdc027584e
|
Provenance
The following attestation bundles were made for dwd_opendata-0.1.0.tar.gz:
Publisher:
build-and-publish.yml on iskur/dwd_opendata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dwd_opendata-0.1.0.tar.gz -
Subject digest:
ab572394e33d7e58ffcbb38ad8365320878849021718637cd7fb806d0cf1bb6c - Sigstore transparency entry: 632758143
- Sigstore integration time:
-
Permalink:
iskur/dwd_opendata@7c7522f6c0c3bae7a84b7af85b29cafc9be1de55 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/iskur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@7c7522f6c0c3bae7a84b7af85b29cafc9be1de55 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dwd_opendata-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dwd_opendata-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d96dcb758dcc7e2099c5d3b79cd327bf7344854d5c9b47861071dc4db3aea773
|
|
| MD5 |
910ea79307617736ab5bb8361cb23f6a
|
|
| BLAKE2b-256 |
5597a138cbd1293804e64117f26005ca9d804f7ef2677a7b4a556db2798c55ee
|
Provenance
The following attestation bundles were made for dwd_opendata-0.1.0-py3-none-any.whl:
Publisher:
build-and-publish.yml on iskur/dwd_opendata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dwd_opendata-0.1.0-py3-none-any.whl -
Subject digest:
d96dcb758dcc7e2099c5d3b79cd327bf7344854d5c9b47861071dc4db3aea773 - Sigstore transparency entry: 632758181
- Sigstore integration time:
-
Permalink:
iskur/dwd_opendata@7c7522f6c0c3bae7a84b7af85b29cafc9be1de55 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/iskur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@7c7522f6c0c3bae7a84b7af85b29cafc9be1de55 -
Trigger Event:
push
-
Statement type: