A simple tool to retrieve weather forecast from DWD OpenData
Project description
Simple DWD weather forecast
DISCLAIMER: This project is a private open source project and doesn't have any connection with Deutscher Wetterdienst.
This is a python package for simple access to hourly forecast data for the next 10 days. The data is updated every six hours and updated when needed.
Available station-IDs can be found here in the third column or you can use the method dwdforecast.get_nearest_station_id(latitude, longitude)
which tries to find it for you.
Forecasted weather conditions are evaluated using this table and then converted into these possible weather conditions:
- sunny
- partlycloudy
- cloudy
- rainy
- snowy-rainy
- snowy
- pouring
- lightning-rainy
Installation
python3 -m pip install simple_dwd_weatherforecast
Usage
from simple_dwd_weatherforecast import dwdforecast
from datetime import datetime, timedelta
#Find nearest Station-ID automatically
#id = dwdforecast.get_nearest_station_id(50.1109221, 8.6821267)
dwd_weather = dwdforecast.Weather("10385") # Station-ID For BERLIN-SCHOENEFELD
time_now = datetime.now()
temperature_now = dwd_weather.get_forecast_temperature(time_now)
time_tomorrow = datetime.now()+timedelta(days=1)
temperature_tomorrow = dwd_weather.get_forecast_temperature(time_tomorrow)
Available methods
All methods return their values as string. If no data is available for this datetime, None will be returned.
dwdforecast.get_nearest_station_id(latitude,longitude) #Returns nearest Station-ID
get_station_name() #Return Station name
get_forecast_condition(datetime) #Result is condition as text
get_forecast_temperature(datetime) #Result is in degrees Celcius
get_forecast_pressure(datetime) #Result is in hPa
get_forecast_wind_direction(datetime) #Result is in degrees magnetic
get_forecast_wind_speed(datetime) #Result is in m/s
get_forecast_precipitation(datetime) #Result is in kg/m2
get_forecast_precipitation_probability(datetime) #Result is in percent
get_forecast_cloud_coverage(datetime) #Result is in percent
get_forecast_visibility(datetime) #Result is in meters
get_forecast_sun_duration(datetime) #Result is in minutes of the last hour
get_daily_temp_max(datetime) #Result is in degrees Celcius
get_daily_temp_min(datetime) #Result is in degrees Celcius
get_daily_condition(datetime) #Result is worst condition at this day
Licenses
This package uses public data from DWD OpenData. The Copyright can be viewed here.
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
Hashes for simple_dwd_weatherforecast-0.9.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cae21fc836bb7ef8131001e62fe125cb6d3af70036e3f8fd4641d136caed6dbd |
|
MD5 | 87e53968838b8d417d88a7a5e835204f |
|
BLAKE2b-256 | 55be1c62830c8816a0f75b19cc318b3c3a27320832e681abbf21f7511db0fd15 |
Hashes for simple_dwd_weatherforecast-0.9.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2045b4270b85dad246944ecd515a973a292c4df43c612312c9f49ae593c0e1 |
|
MD5 | 04c56bcb823995f1186b1dbffa685652 |
|
BLAKE2b-256 | 73975ac7c40d614febe48ef7f887bed19e69c1d1bb3c3fae87bb684399df84a0 |