{"id":6882,"library":"simple-dwd-weatherforecast","title":"Simple DWD Weatherforecast","description":"Simple DWD Weatherforecast is a Python library (version 3.4.1) providing a straightforward tool to retrieve weather forecasts from DWD (Deutscher Wetterdienst) OpenData. It allows access to hourly forecast data for the next 10 days, reported weather conditions, weather maps from the DWD GeoServer, and air quality measurements and forecasts. The project is actively maintained with frequent updates.","status":"active","version":"3.4.1","language":"en","source_language":"en","source_url":"https://github.com/FL550/simple_dwd_weatherforecast.git","tags":["weather","forecast","dwd","opendata","germany","air-quality"],"install":[{"cmd":"pip install simple-dwd-weatherforecast","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for internal data processing; reported as a missing module in some environments, particularly older Home Assistant versions.","package":"stream-unzip","optional":false},{"reason":"Required for internal data processing; build failures reported in certain environments, especially with newer Python versions or Home Assistant beta builds.","package":"stream-inflate","optional":false}],"imports":[{"note":"Main module for weather forecast data.","symbol":"dwdforecast","correct":"from simple_dwd_weatherforecast import dwdforecast"},{"note":"Module for retrieving DWD weather maps.","symbol":"dwdmap","correct":"from simple_dwd_weatherforecast import dwdmap"}],"quickstart":{"code":"from simple_dwd_weatherforecast import dwdforecast\nfrom datetime import datetime, timezone\n\n# Find nearest Station-ID automatically (uncomment to use)\n# id = dwdforecast.get_nearest_station_id(50.1109221, 8.6821267)\n\n# Or use a known Station-ID, e.g., for BERLIN-SCHOENEFELD\nstation_id = \"10385\"\ndwd_weather = dwdforecast.Weather(station_id)\n\ntime_now = datetime.now(timezone.utc)\n\ntry:\n    temperature_now = dwd_weather.get_forecast_data(dwdforecast.WeatherDataType.TEMPERATURE_2M, time_now)\n    print(f\"Temperature at {station_id} ({time_now.isoformat()} UTC): {temperature_now}°C\")\n\n    # Get a specific forecast for a few hours later\n    future_time = time_now.replace(hour=(time_now.hour + 3) % 24) # Example: 3 hours later on the same day\n    future_temp = dwd_weather.get_forecast_data(dwdforecast.WeatherDataType.TEMPERATURE_2M, future_time)\n    print(f\"Temperature at {station_id} ({future_time.isoformat()} UTC): {future_temp}°C\")\n\n    # Get weather condition (requires manual conversion from digit value if not using helper)\n    weather_condition_code = dwd_weather.get_forecast_data(dwdforecast.WeatherDataType.WEATHER_CONDITION, time_now)\n    print(f\"Weather condition code: {weather_condition_code}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure the station ID is valid and DWD data is available for the requested time.\")\n\n","lang":"python","description":"This quickstart demonstrates how to initialize the `Weather` object with a station ID and retrieve current and future temperature forecasts. It also shows how to get the raw weather condition code. Station IDs can be found via `get_nearest_station_id` or from DWD's official lists. All datetime objects passed to the library should be in UTC."},"warnings":[{"fix":"Be mindful of network usage and data completeness when using `force_hourly=True`. Consider if these specific elements are critical for your application.","message":"When fetching hourly data by setting `force_hourly=True`, the library downloads approximately 37MB of data per call. Additionally, this mode may omit some data elements like `PRECIPITATION_PROBABILITY` and `PRECIPITATION_DURATION`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always use `datetime.now(timezone.utc)` or ensure any `datetime` objects are explicitly set to UTC before passing them to `simple-dwd-weatherforecast` functions.","message":"Datetime values provided to library methods must always be in UTC. Providing naive datetimes or datetimes in other timezones can lead to incorrect data retrieval or errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Implement a mapping or use an existing utility (if provided by the library) to convert the numerical weather condition codes into descriptive strings.","message":"Weather condition data is returned as a raw digit value provided by DWD. Users are responsible for converting these codes into human-readable conditions, though simplified conversion tables might be available within the library's source code or documentation.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure that `stream-unzip` and `stream-inflate` are correctly installed and compatible with your Python version. Sometimes, upgrading `simple-dwd-weatherforecast` to its latest version (which might include updated dependency specifications) or manually installing specific versions of `stream-unzip`/`stream-inflate` can resolve the issue.","message":"Unexpected `ModuleNotFoundError` for `stream_unzip` or `stream_inflate`, or build failures related to these packages, have been reported in certain environments (e.g., Home Assistant, specific Python versions, or beta builds). This indicates dependency resolution issues.","severity":"gotcha","affected_versions":"All versions, particularly when integrating with Home Assistant or specific Python environments."}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}