PyMetno 0.12.0__tar.gz → 0.13.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyMetno
3
- Version: 0.12.0
3
+ Version: 0.13.0
4
4
  Summary: A library to communicate with the met.no api
5
5
  Home-page: https://github.com/Danielhiversen/pyMetno/
6
6
  Author: Daniel Hjelseth Høyer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyMetno
3
- Version: 0.12.0
3
+ Version: 0.13.0
4
4
  Summary: A library to communicate with the met.no api
5
5
  Home-page: https://github.com/Danielhiversen/pyMetno/
6
6
  Author: Daniel Hjelseth Høyer
@@ -167,6 +167,7 @@ class MetWeatherData:
167
167
  daily_windspeed = []
168
168
  daily_windgust = []
169
169
  daily_dew_point = []
170
+ daily_uv_index = []
170
171
  entries = []
171
172
 
172
173
  for time_entry in self.data["properties"]["timeseries"]:
@@ -194,6 +195,9 @@ class MetWeatherData:
194
195
  dew_point = get_data("dew_point_temperature", [time_entry])
195
196
  if dew_point is not None:
196
197
  daily_dew_point.append(dew_point)
198
+ uv_index = get_data("ultraviolet_index_clear_sky", [time_entry])
199
+ if uv_index is not None:
200
+ daily_uv_index.append(uv_index)
197
201
 
198
202
  if time.astimezone() <= timestamp:
199
203
  entries.append(time_entry)
@@ -214,6 +218,7 @@ class MetWeatherData:
214
218
  res["wind_gust"] = get_data("wind_speed_of_gust", entries)
215
219
  res["cloudiness"] = get_data("cloud_area_fraction", entries)
216
220
  res["dew_point"] = get_data("dew_point_temperature", entries)
221
+ res["uv_index"] = get_data("ultraviolet_index_clear_sky", entries)
217
222
  else:
218
223
  res["temperature"] = (
219
224
  None if daily_temperatures == [] else max(daily_temperatures)
@@ -236,6 +241,9 @@ class MetWeatherData:
236
241
  res["dew_point"] = (
237
242
  None if daily_dew_point == [] else max(daily_dew_point)
238
243
  )
244
+ res["uv_index"] = (
245
+ None if daily_uv_index == [] else max(daily_uv_index)
246
+ )
239
247
 
240
248
  return res
241
249
 
@@ -283,6 +291,7 @@ def get_data(param: str, data: List[dict]) -> Any:
283
291
  "air_pressure_at_sea_level",
284
292
  "relative_humidity",
285
293
  "dew_point_temperature",
294
+ "ultraviolet_index_clear_sky",
286
295
  ):
287
296
  new_state = instant_details[param]
288
297
  elif param in ("wind_speed", "wind_speed_of_gust"):
@@ -4,7 +4,7 @@ setup(
4
4
  name = 'PyMetno',
5
5
  packages = ['metno'],
6
6
  install_requires=['xmltodict', "aiohttp>=3.0.6", "async_timeout>=3.0.0"],
7
- version = '0.12.0',
7
+ version = '0.13.0',
8
8
  description = 'A library to communicate with the met.no api',
9
9
  author='Daniel Hjelseth Høyer',
10
10
  url='https://github.com/Danielhiversen/pyMetno/',
File without changes
File without changes
File without changes
File without changes