lhpapi 1.0.7__tar.gz → 1.0.8__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.
- {lhpapi-1.0.7 → lhpapi-1.0.8}/CHANGELOG.md +4 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/PKG-INFO +1 -1
- {lhpapi-1.0.7 → lhpapi-1.0.8}/pyproject.toml +1 -1
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/th_api.py +6 -6
- {lhpapi-1.0.7 → lhpapi-1.0.8}/.gitignore +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/LICENSE +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/README.md +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/__init__.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/api_utils.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/bb_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/be_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/bw_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/by_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/hb_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/he_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/hh_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/mv_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/ni_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/nw_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/rp_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/sh_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/sl_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/sn_api.py +0 -0
- {lhpapi-1.0.7 → lhpapi-1.0.8}/src/lhpapi/st_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lhpapi
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: API to retrieve data from the Länderübergreifendes Hochwasser Portal (LHP)
|
|
5
5
|
Project-URL: Homepage, https://github.com/stephan192/lhpapi
|
|
6
6
|
Project-URL: Issues, https://github.com/stephan192/lhpapi/issues
|
|
@@ -23,7 +23,7 @@ def init_TH(ident: str) -> StaticData: # pylint: disable=invalid-name
|
|
|
23
23
|
# Parse data
|
|
24
24
|
for row in trs:
|
|
25
25
|
tds = row.find_all("td")
|
|
26
|
-
if len(tds) >
|
|
26
|
+
if len(tds) > 3:
|
|
27
27
|
if tds[1].getText().strip() != ident[3:]:
|
|
28
28
|
continue
|
|
29
29
|
links = tds[1].find_all("a")
|
|
@@ -49,10 +49,10 @@ def update_TH(static_data: StaticData) -> DynamicData: # pylint: disable=invali
|
|
|
49
49
|
# Parse data
|
|
50
50
|
for row in trs:
|
|
51
51
|
tds = row.find_all("td")
|
|
52
|
-
if len(tds) >
|
|
52
|
+
if len(tds) > 11:
|
|
53
53
|
if tds[1].getText().strip() != static_data.ident[3:]:
|
|
54
54
|
continue
|
|
55
|
-
if str(tds[
|
|
55
|
+
if str(tds[7]).find("Hochwassermeldepegel") != -1:
|
|
56
56
|
if "w3-purple" in row["class"]:
|
|
57
57
|
stage = 4
|
|
58
58
|
elif "w3-red" in row["class"]:
|
|
@@ -66,10 +66,10 @@ def update_TH(static_data: StaticData) -> DynamicData: # pylint: disable=invali
|
|
|
66
66
|
else:
|
|
67
67
|
stage = None
|
|
68
68
|
last_update = convert_to_datetime(
|
|
69
|
-
tds[
|
|
69
|
+
tds[8].getText().strip(), "%d.%m.%Y %H:%M"
|
|
70
70
|
)
|
|
71
|
-
level = convert_to_float(tds[
|
|
72
|
-
flow = convert_to_float(tds[
|
|
71
|
+
level = convert_to_float(tds[9].getText().strip(), True)
|
|
72
|
+
flow = convert_to_float(tds[11].getText().strip(), True)
|
|
73
73
|
return DynamicData(
|
|
74
74
|
level=level, stage=stage, flow=flow, last_update=last_update
|
|
75
75
|
)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|