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.
@@ -1,3 +1,7 @@
1
+ ## 1.0.8 (2025-12-09)
2
+ ### Fixed
3
+ - Fix TH pegel page scraping
4
+
1
5
  ## 1.0.7 (2025-11-23)
2
6
  ### Fixed
3
7
  - Fix HE without flow
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lhpapi
3
- Version: 1.0.7
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "lhpapi"
7
- version = "1.0.7"
7
+ version = "1.0.8"
8
8
  authors = [
9
9
  { name="stephan192", email="stephan192@outlook.com" },
10
10
  ]
@@ -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) > 10:
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) > 10:
52
+ if len(tds) > 11:
53
53
  if tds[1].getText().strip() != static_data.ident[3:]:
54
54
  continue
55
- if str(tds[6]).find("Hochwassermeldepegel") != -1:
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[7].getText().strip(), "%d.%m.%Y %H:%M"
69
+ tds[8].getText().strip(), "%d.%m.%Y %H:%M"
70
70
  )
71
- level = convert_to_float(tds[8].getText().strip(), True)
72
- flow = convert_to_float(tds[10].getText().strip(), True)
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