lhpapi 1.0.4__tar.gz → 1.0.6__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.4 → lhpapi-1.0.6}/CHANGELOG.md +8 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/LICENSE +1 -1
- {lhpapi-1.0.4 → lhpapi-1.0.6}/PKG-INFO +1 -1
- {lhpapi-1.0.4 → lhpapi-1.0.6}/pyproject.toml +1 -1
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/bb_api.py +8 -2
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/hh_api.py +2 -2
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/rp_api.py +14 -11
- {lhpapi-1.0.4 → lhpapi-1.0.6}/.gitignore +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/README.md +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/__init__.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/api_utils.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/be_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/bw_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/by_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/hb_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/he_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/mv_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/ni_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/nw_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/sh_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/sl_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/sn_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/st_api.py +0 -0
- {lhpapi-1.0.4 → lhpapi-1.0.6}/src/lhpapi/th_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.6
|
|
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
|
|
@@ -70,7 +70,10 @@ def init_BB(ident: str) -> StaticData: # pylint: disable=invalid-name
|
|
|
70
70
|
"""Init data for Brandenburg."""
|
|
71
71
|
try:
|
|
72
72
|
# Get data
|
|
73
|
-
page = fetch_text(
|
|
73
|
+
page = fetch_text(
|
|
74
|
+
"https://pegelportal.brandenburg.de/start.php",
|
|
75
|
+
forced_encoding="ISO-8859-15",
|
|
76
|
+
)
|
|
74
77
|
lines = page.split("\n")
|
|
75
78
|
# Parse data
|
|
76
79
|
start_found = False
|
|
@@ -105,7 +108,10 @@ def update_BB(static_data: StaticData) -> DynamicData: # pylint: disable=invali
|
|
|
105
108
|
"""Update data for Brandenburg."""
|
|
106
109
|
try:
|
|
107
110
|
# Get data
|
|
108
|
-
page = fetch_text(
|
|
111
|
+
page = fetch_text(
|
|
112
|
+
"https://pegelportal.brandenburg.de/start.php",
|
|
113
|
+
forced_encoding="ISO-8859-15",
|
|
114
|
+
)
|
|
109
115
|
lines = page.split("\n")
|
|
110
116
|
# Parse data
|
|
111
117
|
start_found = False
|
|
@@ -54,14 +54,14 @@ def update_HH(static_data: StaticData) -> DynamicData: # pylint: disable=invali
|
|
|
54
54
|
text = div.getText()
|
|
55
55
|
level = convert_to_float(
|
|
56
56
|
text[
|
|
57
|
-
text.find("Wasserstand") + 11 : text.find("[NHN\
|
|
57
|
+
text.find("Wasserstand") + 11 : text.find("[NHN\u00a0+/-\u00a0cm]")
|
|
58
58
|
]
|
|
59
59
|
.replace(".", "")
|
|
60
60
|
.strip()
|
|
61
61
|
)
|
|
62
62
|
last_update = convert_to_datetime(
|
|
63
63
|
text[
|
|
64
|
-
text.find("\
|
|
64
|
+
text.find("\u00a0\u00a0\u00a0 um") + 6 : text.find("Trend")
|
|
65
65
|
].strip(),
|
|
66
66
|
"%d.%m.%Y %H:%M",
|
|
67
67
|
)
|
|
@@ -26,19 +26,22 @@ def init_RP(ident: str) -> StaticData: # pylint: disable=invalid-name
|
|
|
26
26
|
for key in measurementsites:
|
|
27
27
|
site = measurementsites[key]
|
|
28
28
|
if site["number"] == ident[3:]:
|
|
29
|
-
|
|
29
|
+
url = "https://www.hochwasser.rlp.de/"
|
|
30
|
+
if site["type"] == "default":
|
|
31
|
+
name = site["name"] + " / " + rivers[site["rivers"][0]]["name"]
|
|
32
|
+
url = url + "flussgebiet/"
|
|
33
|
+
elif site["type"] == "municipal":
|
|
34
|
+
if site["riverMunicipalName"] is not None:
|
|
35
|
+
name = site["name"] + " / " + site["riverMunicipalName"]
|
|
36
|
+
else:
|
|
37
|
+
name = site["name"]
|
|
38
|
+
else:
|
|
39
|
+
continue
|
|
30
40
|
url = (
|
|
31
|
-
|
|
32
|
-
+ riverareas[str(site["riverAreas"][0])]["
|
|
41
|
+
url
|
|
42
|
+
+ riverareas[str(site["riverAreas"][0])]["slug"]
|
|
33
43
|
+ "/"
|
|
34
|
-
+ site["
|
|
35
|
-
.replace(" ", "-")
|
|
36
|
-
.replace(",", "")
|
|
37
|
-
.replace("ß", "ss")
|
|
38
|
-
.replace("ä", "ae")
|
|
39
|
-
.replace("ö", "oe")
|
|
40
|
-
.replace("ü", "ue")
|
|
41
|
-
.lower()
|
|
44
|
+
+ site["slug"]
|
|
42
45
|
)
|
|
43
46
|
try:
|
|
44
47
|
stage_levels = [None] * 4
|
|
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
|