simple-dwd-weatherforecast 2.0.26__tar.gz → 2.0.27__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.
Files changed (46) hide show
  1. {simple_dwd_weatherforecast-2.0.26/simple_dwd_weatherforecast.egg-info → simple_dwd_weatherforecast-2.0.27}/PKG-INFO +10 -6
  2. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/README.md +9 -5
  3. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/setup.py +1 -1
  4. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast/dwdmap.py +6 -6
  5. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27/simple_dwd_weatherforecast.egg-info}/PKG-INFO +10 -6
  6. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/LICENCE +0 -0
  7. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/setup.cfg +0 -0
  8. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast/__init__.py +0 -0
  9. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast/dwdforecast.py +0 -0
  10. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast/stations.json +0 -0
  11. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast/uv_stations.json +0 -0
  12. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast.egg-info/SOURCES.txt +0 -0
  13. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast.egg-info/dependency_links.txt +0 -0
  14. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast.egg-info/requires.txt +0 -0
  15. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/simple_dwd_weatherforecast.egg-info/top_level.txt +0 -0
  16. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/__init__.py +0 -0
  17. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/dummy_data.py +0 -0
  18. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/dummy_data_full.py +0 -0
  19. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/dummy_uv.py +0 -0
  20. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_daily_condition.py +0 -0
  21. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_daily_max.py +0 -0
  22. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_daily_min.py +0 -0
  23. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_daily_sum.py +0 -0
  24. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_day_values.py +0 -0
  25. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_forecast_condition.py +0 -0
  26. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_forecast_data.py +0 -0
  27. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_station_name.py +0 -0
  28. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_timeframe_avg.py +0 -0
  29. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_timeframe_condition.py +0 -0
  30. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_timeframe_max.py +0 -0
  31. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_timeframe_min.py +0 -0
  32. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_timeframe_sum.py +0 -0
  33. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_get_timeframe_values.py +0 -0
  34. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_is_in_timerange.py +0 -0
  35. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_is_valid_timeframe.py +0 -0
  36. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_location_tools.py +0 -0
  37. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_map.py +0 -0
  38. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_parsekml.py +0 -0
  39. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_region.py +0 -0
  40. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_reported_weather.py +0 -0
  41. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_station.py +0 -0
  42. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_stationsfile.py +0 -0
  43. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_update.py +0 -0
  44. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_update_hourly.py +0 -0
  45. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_uv_index.py +0 -0
  46. {simple_dwd_weatherforecast-2.0.26 → simple_dwd_weatherforecast-2.0.27}/tests/test_weather.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simple_dwd_weatherforecast
3
- Version: 2.0.26
3
+ Version: 2.0.27
4
4
  Summary: A simple tool to retrieve a weather forecast from DWD OpenData
5
5
  Home-page: https://github.com/FL550/simple_dwd_weatherforecast.git
6
6
  Author: Max Fermor
@@ -166,9 +166,13 @@ You can download weather maps from the DWD GeoServer with this package. There ar
166
166
  ```python
167
167
  from simple_dwd_weatherforecast import dwdmap
168
168
 
169
- dwdmap.get_from_location(51.272, 8.84, radius_km=100, map_type=dwdmap.WeatherMapType.NIEDERSCHLAGSRADAR, background_type=dwdmap.WeatherBackgroundMapType.BUNDESLAENDER, file_name="map.png")
169
+ image = dwdmap.get_from_location(51.272, 8.84, radius_km=100, map_type=dwdmap.WeatherMapType.NIEDERSCHLAGSRADAR, background_type=dwdmap.WeatherBackgroundMapType.BUNDESLAENDER)
170
170
 
171
- dwdmap.get_germany(map_type=dwdmap.WeatherMapType.UVINDEX, width=520, height=580, filename="germany.png")
171
+ image.save("niederschlag.png")
172
+
173
+ image = dwdmap.get_germany(map_type=dwdmap.WeatherMapType.UVINDEX, image_width=520, image_height=580)
174
+
175
+ image.save("uvindex.png")
172
176
  ```
173
177
 
174
178
  #### Available methods
@@ -192,11 +196,11 @@ class WeatherBackgroundMapType(Enum):
192
196
  GEMEINDEN = "dwd:Warngebiete_Gemeinden"
193
197
  SATELLIT = "dwd:bluemarble"
194
198
 
195
- def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Saves map with given radius from coordinates
199
+ def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height) #Returns map as pillow image with given radius from coordinates
196
200
 
197
- get_germany(map_type: WeatherMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Saves map of whole germany
201
+ get_germany(map_type: WeatherMapType, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image of whole germany
198
202
 
199
- get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Map retrieval
203
+ get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image
200
204
  ```
201
205
 
202
206
  ## Help and Contribution
@@ -149,9 +149,13 @@ You can download weather maps from the DWD GeoServer with this package. There ar
149
149
  ```python
150
150
  from simple_dwd_weatherforecast import dwdmap
151
151
 
152
- dwdmap.get_from_location(51.272, 8.84, radius_km=100, map_type=dwdmap.WeatherMapType.NIEDERSCHLAGSRADAR, background_type=dwdmap.WeatherBackgroundMapType.BUNDESLAENDER, file_name="map.png")
152
+ image = dwdmap.get_from_location(51.272, 8.84, radius_km=100, map_type=dwdmap.WeatherMapType.NIEDERSCHLAGSRADAR, background_type=dwdmap.WeatherBackgroundMapType.BUNDESLAENDER)
153
153
 
154
- dwdmap.get_germany(map_type=dwdmap.WeatherMapType.UVINDEX, width=520, height=580, filename="germany.png")
154
+ image.save("niederschlag.png")
155
+
156
+ image = dwdmap.get_germany(map_type=dwdmap.WeatherMapType.UVINDEX, image_width=520, image_height=580)
157
+
158
+ image.save("uvindex.png")
155
159
  ```
156
160
 
157
161
  #### Available methods
@@ -175,11 +179,11 @@ class WeatherBackgroundMapType(Enum):
175
179
  GEMEINDEN = "dwd:Warngebiete_Gemeinden"
176
180
  SATELLIT = "dwd:bluemarble"
177
181
 
178
- def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Saves map with given radius from coordinates
182
+ def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height) #Returns map as pillow image with given radius from coordinates
179
183
 
180
- get_germany(map_type: WeatherMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Saves map of whole germany
184
+ get_germany(map_type: WeatherMapType, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image of whole germany
181
185
 
182
- get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Map retrieval
186
+ get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image
183
187
  ```
184
188
 
185
189
  ## Help and Contribution
@@ -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="2.0.26",
8
+ version="2.0.27",
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,
@@ -23,7 +23,7 @@ class WeatherBackgroundMapType(Enum):
23
23
  SATELLIT = "dwd:bluemarble"
24
24
  GEWAESSER = "dwd:Gewaesser"
25
25
 
26
- def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType = WeatherBackgroundMapType.BUNDESLAENDER, image_width=520, image_height=580, filename="map.png"):
26
+ def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType = WeatherBackgroundMapType.BUNDESLAENDER, image_width=520, image_height=580):
27
27
  if radius_km <= 0:
28
28
  raise ValueError("Radius must be greater than 0")
29
29
  if latitude < -90 or latitude > 90:
@@ -31,12 +31,12 @@ def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType,
31
31
  if longitude < -180 or longitude > 180:
32
32
  raise ValueError("Longitude must be between -180 and 180")
33
33
  radius = math.fabs(radius_km / (111.3 * math.cos(latitude)))
34
- get_map(latitude-radius, longitude-radius, latitude+radius, longitude+radius, map_type, background_type, image_width, image_height, filename)
34
+ return get_map(latitude-radius, longitude-radius, latitude+radius, longitude+radius, map_type, background_type, image_width, image_height)
35
35
 
36
- def get_germany(map_type: WeatherMapType, image_width=520, image_height=580, filename="map.png"):
37
- get_map(4.4, 46.4, 16.1, 55.6, map_type, WeatherBackgroundMapType.BUNDESLAENDER, image_width, image_height, filename)
36
+ def get_germany(map_type: WeatherMapType, image_width=520, image_height=580):
37
+ return get_map(4.4, 46.4, 16.1, 55.6, map_type, WeatherBackgroundMapType.BUNDESLAENDER, image_width, image_height)
38
38
 
39
- def get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, image_width=520, image_height=580, filename="map.png"):
39
+ def get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, image_width=520, image_height=580):
40
40
  if image_width > 1200 or image_height > 1400:
41
41
  raise ValueError("Width and height must not exceed 1200 and 1400 respectively. Please be kind to the DWD servers.")
42
42
 
@@ -44,4 +44,4 @@ def get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: Weat
44
44
  request = requests.get(url, stream=True)
45
45
  if request.status_code == 200:
46
46
  image = Image.open(BytesIO(request.content))
47
- image.save(filename)
47
+ return image
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simple_dwd_weatherforecast
3
- Version: 2.0.26
3
+ Version: 2.0.27
4
4
  Summary: A simple tool to retrieve a weather forecast from DWD OpenData
5
5
  Home-page: https://github.com/FL550/simple_dwd_weatherforecast.git
6
6
  Author: Max Fermor
@@ -166,9 +166,13 @@ You can download weather maps from the DWD GeoServer with this package. There ar
166
166
  ```python
167
167
  from simple_dwd_weatherforecast import dwdmap
168
168
 
169
- dwdmap.get_from_location(51.272, 8.84, radius_km=100, map_type=dwdmap.WeatherMapType.NIEDERSCHLAGSRADAR, background_type=dwdmap.WeatherBackgroundMapType.BUNDESLAENDER, file_name="map.png")
169
+ image = dwdmap.get_from_location(51.272, 8.84, radius_km=100, map_type=dwdmap.WeatherMapType.NIEDERSCHLAGSRADAR, background_type=dwdmap.WeatherBackgroundMapType.BUNDESLAENDER)
170
170
 
171
- dwdmap.get_germany(map_type=dwdmap.WeatherMapType.UVINDEX, width=520, height=580, filename="germany.png")
171
+ image.save("niederschlag.png")
172
+
173
+ image = dwdmap.get_germany(map_type=dwdmap.WeatherMapType.UVINDEX, image_width=520, image_height=580)
174
+
175
+ image.save("uvindex.png")
172
176
  ```
173
177
 
174
178
  #### Available methods
@@ -192,11 +196,11 @@ class WeatherBackgroundMapType(Enum):
192
196
  GEMEINDEN = "dwd:Warngebiete_Gemeinden"
193
197
  SATELLIT = "dwd:bluemarble"
194
198
 
195
- def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Saves map with given radius from coordinates
199
+ def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height) #Returns map as pillow image with given radius from coordinates
196
200
 
197
- get_germany(map_type: WeatherMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Saves map of whole germany
201
+ get_germany(map_type: WeatherMapType, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image of whole germany
198
202
 
199
- get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string filename (default:"map.png")) #Map retrieval
203
+ get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image
200
204
  ```
201
205
 
202
206
  ## Help and Contribution