simple-dwd-weatherforecast 3.0.2__tar.gz → 3.0.3__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.2/simple_dwd_weatherforecast.egg-info → simple_dwd_weatherforecast-3.0.3}/PKG-INFO +1 -1
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/setup.py +1 -1
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast/dwdmap.py +8 -27
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3/simple_dwd_weatherforecast.egg-info}/PKG-INFO +1 -1
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/LICENCE +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/README.md +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/setup.cfg +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast/__init__.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast/dwdforecast.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast/stations.json +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast/uv_stations.json +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast.egg-info/SOURCES.txt +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast.egg-info/dependency_links.txt +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast.egg-info/requires.txt +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/simple_dwd_weatherforecast.egg-info/top_level.txt +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/__init__.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/dummy_data.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/dummy_data_full.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/dummy_uv.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_avg.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_condition.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_max.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_min.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_sum.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_day_values.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_forecast_condition.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_forecast_data.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_station_name.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_timeframe_avg.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_timeframe_condition.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_timeframe_max.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_timeframe_min.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_timeframe_sum.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_timeframe_values.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_is_in_timerange.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_is_valid_timeframe.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_location_tools.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_map.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_parsekml.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_region.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_reported_weather.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_station.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_stationsfile.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_update.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_update_hourly.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_uv_index.py +0 -0
- {simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/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.3",
|
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,
|
@@ -182,8 +182,10 @@ def get_map(
|
|
182
182
|
layers = f"{','.join(special_layers)},{map_layers},{','.join(other_layers)}".lstrip(
|
183
183
|
","
|
184
184
|
).rstrip(",")
|
185
|
-
|
186
|
-
|
185
|
+
bgcolor = "0xFFFFFF"
|
186
|
+
if dark_mode:
|
187
|
+
bgcolor = "0x1C1C1C"
|
188
|
+
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&bgcolor={bgcolor}"
|
187
189
|
|
188
190
|
request = requests.get(url, stream=True)
|
189
191
|
if request.status_code == 200:
|
@@ -193,18 +195,6 @@ def get_map(
|
|
193
195
|
raise RuntimeError(
|
194
196
|
f"Error during image request from DWD servers: {url}"
|
195
197
|
) from e
|
196
|
-
if dark_mode:
|
197
|
-
new_image_data = []
|
198
|
-
for item in image.getdata(): # type: ignore
|
199
|
-
if item[0] == 255 and item[1] == 255 and item[2] == 255:
|
200
|
-
new_image_data.append((28, 28, 28))
|
201
|
-
elif item[0] == 85 and item[1] == 85 and item[2] == 85:
|
202
|
-
new_image_data.append((155, 155, 155))
|
203
|
-
else:
|
204
|
-
new_image_data.append(item)
|
205
|
-
|
206
|
-
# update image data
|
207
|
-
image.putdata(new_image_data)
|
208
198
|
image = draw_marker(image, ImageBoundaries(minx, maxx, miny, maxy), markers)
|
209
199
|
return image
|
210
200
|
else:
|
@@ -330,7 +320,10 @@ class ImageLoop:
|
|
330
320
|
","
|
331
321
|
).rstrip(",")
|
332
322
|
)
|
333
|
-
|
323
|
+
bgcolor = "0xFFFFFF"
|
324
|
+
if self.dark_mode:
|
325
|
+
bgcolor = "0x1C1C1C"
|
326
|
+
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')}&bgcolor={bgcolor}"
|
334
327
|
request = requests.get(url, stream=True)
|
335
328
|
if request.status_code != 200 or request.headers["content-type"] != "image/png":
|
336
329
|
raise ConnectionError(f"Error during image request from DWD servers: {url}")
|
@@ -340,18 +333,6 @@ class ImageLoop:
|
|
340
333
|
raise RuntimeError(
|
341
334
|
f"Error during image request from DWD servers: {url}"
|
342
335
|
) from e
|
343
|
-
if self.dark_mode:
|
344
|
-
new_image_data = []
|
345
|
-
for item in image.getdata(): # type: ignore
|
346
|
-
if item[0] == 255 and item[1] == 255 and item[2] == 255:
|
347
|
-
new_image_data.append((28, 28, 28))
|
348
|
-
elif item[0] == 85 and item[1] == 85 and item[2] == 85:
|
349
|
-
new_image_data.append((155, 155, 155))
|
350
|
-
else:
|
351
|
-
new_image_data.append(item)
|
352
|
-
|
353
|
-
# update image data
|
354
|
-
image.putdata(new_image_data)
|
355
336
|
image = draw_marker(
|
356
337
|
image,
|
357
338
|
ImageBoundaries(self._minx, self._maxx, self._miny, self._maxy),
|
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.2 → simple_dwd_weatherforecast-3.0.3}/tests/dummy_data_full.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_avg.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_max.py
RENAMED
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_min.py
RENAMED
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_daily_sum.py
RENAMED
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_get_day_values.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/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.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_is_in_timerange.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_location_tools.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_parsekml.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_reported_weather.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_stationsfile.py
RENAMED
File without changes
|
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_update_hourly.py
RENAMED
File without changes
|
{simple_dwd_weatherforecast-3.0.2 → simple_dwd_weatherforecast-3.0.3}/tests/test_uv_index.py
RENAMED
File without changes
|
File without changes
|