simple-dwd-weatherforecast 3.0.0__tar.gz → 3.0.2__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.
- {simple_dwd_weatherforecast-3.0.0/simple_dwd_weatherforecast.egg-info → simple_dwd_weatherforecast-3.0.2}/PKG-INFO +1 -1
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/setup.py +1 -1
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast/dwdmap.py +18 -7
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2/simple_dwd_weatherforecast.egg-info}/PKG-INFO +1 -1
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/LICENCE +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/README.md +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/setup.cfg +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast/__init__.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast/dwdforecast.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast/stations.json +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast/uv_stations.json +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast.egg-info/SOURCES.txt +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast.egg-info/dependency_links.txt +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast.egg-info/requires.txt +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/simple_dwd_weatherforecast.egg-info/top_level.txt +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/__init__.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/dummy_data.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/dummy_data_full.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/dummy_uv.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_avg.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_condition.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_max.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_min.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_sum.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_day_values.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_forecast_condition.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_forecast_data.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_station_name.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_timeframe_avg.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_timeframe_condition.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_timeframe_max.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_timeframe_min.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_timeframe_sum.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_timeframe_values.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_is_in_timerange.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_is_valid_timeframe.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_location_tools.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_map.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_parsekml.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_region.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_reported_weather.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_station.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_stationsfile.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_update.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_update_hourly.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_uv_index.py +0 -0
- {simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_weather.py +0 -0
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
5
5
|
|
6
6
|
setuptools.setup(
|
7
7
|
name="simple_dwd_weatherforecast",
|
8
|
-
version="v3.0.
|
8
|
+
version="v3.0.2",
|
9
9
|
author="Max Fermor",
|
10
10
|
description="A simple tool to retrieve a weather forecast from DWD OpenData",
|
11
11
|
long_description=long_description,
|
@@ -181,13 +181,18 @@ def get_map(
|
|
181
181
|
# Combine layers with special layers first, then map types, then other layers
|
182
182
|
layers = f"{','.join(special_layers)},{map_layers},{','.join(other_layers)}".lstrip(
|
183
183
|
","
|
184
|
-
)
|
184
|
+
).rstrip(",")
|
185
185
|
|
186
186
|
url = f"https://maps.dwd.de/geoserver/dwd/wms?service=WMS&version=1.3.0&request=GetMap&layers={layers}&bbox={miny},{minx},{maxy},{maxx}&width={image_width}&height={image_height}&srs=EPSG:4326&styles=&format=image/png"
|
187
|
-
|
187
|
+
|
188
188
|
request = requests.get(url, stream=True)
|
189
189
|
if request.status_code == 200:
|
190
|
-
|
190
|
+
try:
|
191
|
+
image = Image.open(BytesIO(request.content))
|
192
|
+
except Exception as e:
|
193
|
+
raise RuntimeError(
|
194
|
+
f"Error during image request from DWD servers: {url}"
|
195
|
+
) from e
|
191
196
|
if dark_mode:
|
192
197
|
new_image_data = []
|
193
198
|
for item in image.getdata(): # type: ignore
|
@@ -202,6 +207,8 @@ def get_map(
|
|
202
207
|
image.putdata(new_image_data)
|
203
208
|
image = draw_marker(image, ImageBoundaries(minx, maxx, miny, maxy), markers)
|
204
209
|
return image
|
210
|
+
else:
|
211
|
+
raise ConnectionError(f"Error during image request from DWD servers: {url}")
|
205
212
|
|
206
213
|
|
207
214
|
class ImageLoop:
|
@@ -321,14 +328,18 @@ class ImageLoop:
|
|
321
328
|
layers = (
|
322
329
|
f"{','.join(special_layers)},{map_layers},{','.join(other_layers)}".lstrip(
|
323
330
|
","
|
324
|
-
)
|
331
|
+
).rstrip(",")
|
325
332
|
)
|
326
333
|
url = f"https://maps.dwd.de/geoserver/dwd/wms?service=WMS&version=1.3.0&request=GetMap&layers={layers}&bbox={self._miny},{self._minx},{self._maxy},{self._maxx}&width={self._image_width}&height={self._image_height}&srs=EPSG:4326&styles=&format=image/png&TIME={date.strftime('%Y-%m-%dT%H:%M:00.0Z')}"
|
327
|
-
print(url)
|
328
334
|
request = requests.get(url, stream=True)
|
329
335
|
if request.status_code != 200 or request.headers["content-type"] != "image/png":
|
330
|
-
raise ConnectionError("Error during image request from DWD servers")
|
331
|
-
|
336
|
+
raise ConnectionError(f"Error during image request from DWD servers: {url}")
|
337
|
+
try:
|
338
|
+
image = Image.open(BytesIO(request.content))
|
339
|
+
except Exception as e:
|
340
|
+
raise RuntimeError(
|
341
|
+
f"Error during image request from DWD servers: {url}"
|
342
|
+
) from e
|
332
343
|
if self.dark_mode:
|
333
344
|
new_image_data = []
|
334
345
|
for item in image.getdata(): # type: ignore
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/dummy_data_full.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_avg.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_max.py
RENAMED
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_min.py
RENAMED
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_daily_sum.py
RENAMED
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_day_values.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_get_station_name.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_is_in_timerange.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_location_tools.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_parsekml.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_reported_weather.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_stationsfile.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_update_hourly.py
RENAMED
File without changes
|
{simple_dwd_weatherforecast-3.0.0 → simple_dwd_weatherforecast-3.0.2}/tests/test_uv_index.py
RENAMED
File without changes
|
File without changes
|