dwdpheno 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. dwdpheno-1.0.0/CHANGELOG.md +44 -0
  2. dwdpheno-1.0.0/CITATION.cff +28 -0
  3. dwdpheno-1.0.0/CONTRIBUTING.md +39 -0
  4. dwdpheno-1.0.0/LICENSE +21 -0
  5. dwdpheno-1.0.0/MANIFEST.in +5 -0
  6. dwdpheno-1.0.0/PKG-INFO +679 -0
  7. dwdpheno-1.0.0/README.md +643 -0
  8. dwdpheno-1.0.0/dwdpheno/__init__.py +31 -0
  9. dwdpheno-1.0.0/dwdpheno/__main__.py +5 -0
  10. dwdpheno-1.0.0/dwdpheno/_catalog.py +398 -0
  11. dwdpheno-1.0.0/dwdpheno/_download.py +211 -0
  12. dwdpheno-1.0.0/dwdpheno/_http.py +136 -0
  13. dwdpheno-1.0.0/dwdpheno/_plot.py +357 -0
  14. dwdpheno-1.0.0/dwdpheno/_quality.py +58 -0
  15. dwdpheno-1.0.0/dwdpheno/_series.py +279 -0
  16. dwdpheno-1.0.0/dwdpheno/_stations.py +354 -0
  17. dwdpheno-1.0.0/dwdpheno/_text.py +71 -0
  18. dwdpheno-1.0.0/dwdpheno/cli.py +299 -0
  19. dwdpheno-1.0.0/dwdpheno/data/cities.txt +7127 -0
  20. dwdpheno-1.0.0/dwdpheno/data/counties.geojson +1 -0
  21. dwdpheno-1.0.0/dwdpheno/data/regions.txt +80184 -0
  22. dwdpheno-1.0.0/dwdpheno/data/states.geojson +1 -0
  23. dwdpheno-1.0.0/dwdpheno.egg-info/PKG-INFO +679 -0
  24. dwdpheno-1.0.0/dwdpheno.egg-info/SOURCES.txt +49 -0
  25. dwdpheno-1.0.0/dwdpheno.egg-info/dependency_links.txt +1 -0
  26. dwdpheno-1.0.0/dwdpheno.egg-info/entry_points.txt +2 -0
  27. dwdpheno-1.0.0/dwdpheno.egg-info/requires.txt +8 -0
  28. dwdpheno-1.0.0/dwdpheno.egg-info/top_level.txt +1 -0
  29. dwdpheno-1.0.0/pyproject.toml +64 -0
  30. dwdpheno-1.0.0/setup.cfg +4 -0
  31. dwdpheno-1.0.0/tests/conftest.py +59 -0
  32. dwdpheno-1.0.0/tests/fixtures/PH_Beschreibung_Pflanze.txt +293 -0
  33. dwdpheno-1.0.0/tests/fixtures/PH_Beschreibung_Phaenologie_Stationen_Jahresmelder.txt +23 -0
  34. dwdpheno-1.0.0/tests/fixtures/PH_Beschreibung_Phaenologie_Stationen_Sofortmelder.txt +11 -0
  35. dwdpheno-1.0.0/tests/fixtures/PH_Beschreibung_Phase.txt +51 -0
  36. dwdpheno-1.0.0/tests/fixtures/PH_Beschreibung_Phasendefinition_Jahresmelder_Landwirtschaft_Kulturpflanze.txt +144 -0
  37. dwdpheno-1.0.0/tests/fixtures/PH_Jahresmelder_Landwirtschaft_Kulturpflanze_Winterweizen_1925_2024_hist.txt +59 -0
  38. dwdpheno-1.0.0/tests/fixtures/PH_Jahresmelder_Landwirtschaft_Kulturpflanze_Winterweizen_akt.txt +25 -0
  39. dwdpheno-1.0.0/tests/fixtures/listing_annual_crops_historical.html +57 -0
  40. dwdpheno-1.0.0/tests/fixtures/listing_annual_crops_recent.html +23 -0
  41. dwdpheno-1.0.0/tests/fixtures/listing_annual_fruit_historical.html +51 -0
  42. dwdpheno-1.0.0/tests/test_catalog.py +150 -0
  43. dwdpheno-1.0.0/tests/test_cli.py +98 -0
  44. dwdpheno-1.0.0/tests/test_download.py +155 -0
  45. dwdpheno-1.0.0/tests/test_network.py +19 -0
  46. dwdpheno-1.0.0/tests/test_plot.py +122 -0
  47. dwdpheno-1.0.0/tests/test_quality.py +164 -0
  48. dwdpheno-1.0.0/tests/test_series.py +147 -0
  49. dwdpheno-1.0.0/tests/test_stations.py +168 -0
  50. dwdpheno-1.0.0/tests/test_text.py +69 -0
  51. dwdpheno-1.0.0/tools/build_data.py +162 -0
@@ -0,0 +1,44 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [1.0.0] - 2026-11-13
8
+
9
+ First public release.
10
+
11
+ ### Added
12
+ - `stations()` – the DWD phenology station table (annual and immediate reporters) enriched with
13
+ county (BKG VG2500 point-in-polygon, English county types), nearest place (GeoNames) and
14
+ reporter type, with selection
15
+ by id, name, state, county, city, lat/lon + radius, nearest *k*, bounding box, polygon,
16
+ reporter and activity. With `crops=` (and `years=`, `partition=`, quality filters) only the
17
+ stations that have observations of those crops are returned, with `n_observations`,
18
+ `first_year` and `last_year` (`dwdpheno stations --crops ...`).
19
+ - `crops()` – catalog of every species on the DWD server with English, German and Latin names
20
+ from DWD's plant table (latest historical file version only).
21
+ - `phases()`, `find_bbch()`, `bbch_for()` – English phase names with BBCH codes.
22
+ - `download()` – tidy observations with station metadata, plant and phase names, BBCH codes and
23
+ decoded quality flags; historical/recent overlap de-duplicated (recent wins). Crops are named
24
+ in English, German or as DWD token (exact name first, otherwise word prefixes).
25
+ - `series()` – BBCH time series with data-driven season detection and a shape-preserving PCHIP
26
+ curve; `summary()` – day-of-year statistics with an OLS trend; `plot_station()`.
27
+ - Data quality: `quality=` (DWD quality bytes 1 2 3 5 8 0) and `quality_level=` (1 2 7 10) on
28
+ `download`, `series`, `summary` and `plot_station` (`--quality`, `--quality-level`); by
29
+ default nothing is filtered. `series` point rows carry the quality columns, `summary` counts
30
+ the observations per quality byte and lists the quality levels, and the plot marks corrected,
31
+ confirmed, doubtful and incorrect observations.
32
+ - `series()` has a `season_doy` column (day of the season, 1 = 1 January of the harvest year,
33
+ negative for the autumn before) for comparing seasons, stations and crops on one axis.
34
+ - `plot_series()` – BBCH series of several stations, crops and seasons in one plot or as small
35
+ multiples (`x="date"|"season_doy"`, `color_by="crop"|"station"|"season"`,
36
+ `facet="station"|"crop"`); `plot_station()` is a shorthand for it.
37
+ - `plot_phase_trend()` – day of year of phases against year with OLS trend lines (days per
38
+ decade in the legend). CLI: `dwdpheno plot --x --color-by --facet` with several station ids,
39
+ and `dwdpheno plot-trend`.
40
+ - `places()` – search of the bundled German place list.
41
+ - On-disk cache (historical files never expire, everything else after `max_age_days`) and
42
+ `offline=True`.
43
+ - `dwdpheno` command line tool with `stations crops phases download series summary places plot
44
+ version` (CSV or JSON output).
@@ -0,0 +1,28 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use dwdpheno in your work, please cite it as below and acknowledge the data source (Deutscher Wetterdienst)."
3
+ type: software
4
+ title: "dwdpheno: download plant-phenology observations of the German Weather Service (DWD)"
5
+ version: 1.0.0
6
+ date-released: 2026-11-13
7
+ license: MIT
8
+ repository-code: "https://github.com/Bluerrror/DWDPheno"
9
+ url: "https://github.com/Bluerrror/DWDPheno"
10
+ authors:
11
+ - family-names: Shojaeezadeh
12
+ given-names: Shahab A.
13
+ email: shahab2710@gmail.com
14
+ keywords:
15
+ - phenology
16
+ - DWD
17
+ - BBCH
18
+ - crops
19
+ - agriculture
20
+ - climate
21
+ - open data
22
+ references:
23
+ - type: data
24
+ title: "Phenological observations in Germany (annual and immediate reporters)"
25
+ authors:
26
+ - name: "Deutscher Wetterdienst (DWD), Climate Data Center"
27
+ url: "https://opendata.dwd.de/climate_environment/CDC/observations_germany/phenology/"
28
+ license: CC-BY-4.0
@@ -0,0 +1,39 @@
1
+ # Contributing
2
+
3
+ Bug reports, ideas and pull requests are welcome at
4
+ <https://github.com/Bluerrror/DWDPheno/issues>.
5
+
6
+ ## Development setup
7
+
8
+ ```bash
9
+ git clone https://github.com/Bluerrror/DWDPheno
10
+ cd DWDPheno
11
+ python -m venv .venv
12
+ # Windows: .venv\Scripts\activate Linux/macOS: source .venv/bin/activate
13
+ pip install -e ".[test,plot]"
14
+ pytest # offline tests (DWD responses are served from tests/fixtures)
15
+ pytest -m network # one small live download from opendata.dwd.de
16
+ ```
17
+
18
+ ## Guidelines
19
+
20
+ - Keep the dependencies to `pandas` and `numpy` (`matplotlib` stays optional) and use the
21
+ standard library for HTTP.
22
+ - Keep the column names and their order stable: they are part of the public API.
23
+ - The package must work with pandas 1.5 through 3.x (copy-on-write, default string dtype) and
24
+ Python 3.9+.
25
+ - Every behaviour change needs a test. Tests must run offline: add a trimmed real DWD file to
26
+ `tests/fixtures/` and route its URL in `tests/conftest.py`.
27
+ - Update `CHANGELOG.md`.
28
+
29
+ ## Reference data
30
+
31
+ `dwdpheno/data/` (administrative boundaries and places) is generated by
32
+ `python tools/build_data.py`, which downloads BKG VG2500 and the GeoNames dump. Commit the
33
+ regenerated files together with a note in the changelog.
34
+
35
+ ## Releasing
36
+
37
+ 1. Bump `__version__` in `dwdpheno/__init__.py`, update `CHANGELOG.md` and `CITATION.cff`.
38
+ 2. Create a GitHub release; the `publish` workflow builds the package and uploads it to PyPI
39
+ (trusted publishing).
dwdpheno-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shahab A. Shojaeezadeh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include LICENSE README.md CHANGELOG.md CITATION.cff CONTRIBUTING.md
2
+ recursive-include dwdpheno/data *.txt *.geojson
3
+ graft tests
4
+ graft tools
5
+ global-exclude __pycache__ *.py[cod]