Package: dwdweather2
dwdweather2Python client to access weather data from Deutscher Wetterdienst
(DWD), the federal meteorological service in
Germany.NotePlease note this library will gradually be phased out.
You should consider using its successor library “Wetterdienst”.Installationpip install dwdweather2SynopsisCommand line usageGet all stations withdailyresolution:dwdweather stations --resolution=dailyGet all stations withhourlyresolution (default):dwdweather stations --resolution=hourlyGet all stations with10_minutesresolution:dwdweather stations --resolution=10_minutesGet closest station (first argument is longitude, second is latitude):dwdweather station 7.0 51.0Export stations as CSV:dwdweather stations --type csv --file stations.csvExport stations as GeoJSON:dwdweather stations --type geojson --file stations.geojsonGet weather at station for certain hour (UTC):dwdweather weather 2667 2019-06-01T15:00To restrict the import to specified categories, run the program like:dwdweather weather 2667 2019-06-01T15:00 --categories air_temperature precipitation pressureFinally, to drop the cache database before performing any work, use the--reset-cacheoption:dwdweather stations --reset-cacheChoose dataset withdailyresolution:dwdweather weather 44 2020-06-01 --resolution=dailyChoose dataset withhourlyresolution:dwdweather weather 44 2020-06-01T08 --resolution=hourlyChoose dataset with10_minutesresolution:dwdweather weather 2667 2019-06-01T15:20 --resolution=10_minutesUsage as libraryfromdatetimeimportdatetimefromdwdweatherimportDwdWeather# Create client object.dwd=DwdWeather(resolution="hourly")# Find closest station to position.closest=dwd.nearest_station(lon=7.0,lat=51.0)# The hour you're interested in.# The example is 2014-03-22 12:00 (UTC).query_hour=datetime(2014,3,22,12)result=dwd.query(station_id=closest["station_id"],timestamp=query_hour)print(result)DwdWeather.query()returns a dictionary with the full set of
possible keys as outlined indoc/usage-library.rst.NotesData is cached in a local sqlite3 database to improve query
performance for consecutive invocations.The “stations cache” is filled upon first request toDwdWeather.stations()orDwdWeather.nearest_station()The “stations cache” will not be refreshed automatically. UseDwdWeather.import_stations()to do this.The “measures cache” is filled upon first access to measures usingDwdWeather.query()and updated whenever a query cannot be
fulfilled from the cache.The cache by default resides in the~/.dwd-weatherdirectory.
This can be controlled using thecachepathargument ofDwdWeather().The amount of data can be ~60 MB per station for full historic extent
and will obviously increase by time.If weather data is queried and the query can’t be fulfilled from the
cache, data is loaded from the server - even if the data has been
updated a second before. If the server doesn’t have data for the
requested time (e.g. since it’s not yet available), this
unnecessarily causes network traffic and wait time. Certainly space
for improvement here.LicensesCode licenseLicensed under the MIT license. SeeLICENSEfor details.Data licenseThe DWD has information about their terms of use policy inGermanandEnglish.Project informationCreditsThanks toMarian Steinbach, all
other contributors and theDWD.ChangelogSee fileCHANGES.rst.Other projectshttps://github.com/earthobservations/wetterdiensthttps://github.com/na-boa/brightskyhttps://github.com/stephan192/dwdwfsapihttps://github.com/jlewis91/dwdbulkhttps://github.com/domschl/python-dwd-forecasthttps://github.com/FL550/simple_dwd_weatherforecasthttps://github.com/astoeckel/pydwdapihttps://github.com/ckaus/pydwdhttps://github.com/hiveeyes/phenodatahttps://github.com/hiveeyes/apicasthttps://github.com/brry/rdwdhttps://github.com/scoute-dich/Weatherhttps://github.com/buwx/meteogramhttps://github.com/clerie/wetterhttps://github.com/dj0001/DWD-Warnmodul-2https://github.com/FWidm/dwd-hourly-crawlerhttps://github.com/ekeih/dwdpollenhttps://github.com/marcschumacher/dwd_pollenhttps://github.com/schmupu/ioBroker.pollenflughttps://github.com/LukeSkywalker92/MMM-DWD-WarnWeatherhttps://github.com/devduisburg/MMM-pollenhttps://github.com/Pix—/vis_widget_dwd_pollenflughttps://github.com/codeformuenster/mosmix-apihttps://github.com/codeformuenster/mosmix-processorhttps://github.com/DouglasFletcher/germanwetterhttps://github.com/wradlibhttps://github.com/jkreklow/radprochttps://github.com/beltoforion/Synthetischer-Wetterberichthttps://beltoforion.de/de/wetterbericht/