hamsclientfork 0.2.8__tar.gz → 0.2.9__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: hamsclientfork
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: Library to get data from meteo swiss
5
5
  Home-page: https://github.com/Rudd-O/hamsclientfork
6
6
  Author: websylv
@@ -15,6 +15,10 @@ Classifier: Programming Language :: Python :: 3.9
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  License-File: LICENSE
18
+ Requires-Dist: requests>=2.22.0
19
+ Requires-Dist: pandas>=0.25.3
20
+ Requires-Dist: beautifulsoup4>=4.8.2
21
+ Requires-Dist: geopy>=2.0.0
18
22
 
19
23
  meteoswiss
20
24
  ==========
@@ -327,19 +327,22 @@ class meteoSwissClient:
327
327
 
328
328
  def getGeoData(self, lat, lon):
329
329
  s = requests.Session()
330
- lat = str(lat)
331
- lon = str(lon)
332
330
  s.headers.update(_HEADERS)
333
331
 
334
- geoData = s.get(
335
- "https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat="
336
- + lat
337
- + "&lon="
338
- + lon
339
- + "&zoom=18"
340
- ).text
341
- _LOGGER.debug("Got data from OpenStreetMap: %s" % (geoData))
342
- return json.loads(geoData)
332
+ uri = (
333
+ "https://nominatim.openstreetmap.org/reverse"
334
+ f"?format=jsonv2&lat={lat}&lon={lon}&zoom=18"
335
+ )
336
+ _LOGGER.debug("Requesting Nominatim OSM data at URL %s", uri)
337
+ geoData_req = s.get(uri)
338
+ try:
339
+ geoData_req.raise_for_status()
340
+ geoData = geoData_req.json
341
+ _LOGGER.debug("Got data from OpenStreetMap: %s" % (geoData))
342
+ return geoData
343
+ except Exception:
344
+ _LOGGER.exception("Cannot get Nominatim OSM data: %s", geoData_req.text)
345
+ raise
343
346
 
344
347
  def getPostCode(self, lat, lon):
345
348
  geoData = self.getGeoData(lat, lon)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hamsclientfork
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: Library to get data from meteo swiss
5
5
  Home-page: https://github.com/Rudd-O/hamsclientfork
6
6
  Author: websylv
@@ -15,6 +15,10 @@ Classifier: Programming Language :: Python :: 3.9
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  License-File: LICENSE
18
+ Requires-Dist: requests>=2.22.0
19
+ Requires-Dist: pandas>=0.25.3
20
+ Requires-Dist: beautifulsoup4>=4.8.2
21
+ Requires-Dist: geopy>=2.0.0
18
22
 
19
23
  meteoswiss
20
24
  ==========
@@ -15,7 +15,7 @@ def read(filename):
15
15
 
16
16
  setup(
17
17
  name="hamsclientfork",
18
- version="0.2.8",
18
+ version="0.2.9",
19
19
  url="https://github.com/Rudd-O/hamsclientfork",
20
20
  license="MIT",
21
21
  author="websylv",
File without changes
File without changes
File without changes
File without changes