lhpapi 1.0.4__tar.gz → 1.0.5__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.5 (2025-05-24)
2
+ ### Fixed
3
+ - Fix BB encoding
4
+
1
5
  ## 1.0.4 (2024-12-24)
2
6
  ### Fixed
3
7
  - Fix NI invalid values
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 stephan192
3
+ Copyright (c) 2025 stephan192
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lhpapi
3
- Version: 1.0.4
3
+ Version: 1.0.5
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.4"
7
+ version = "1.0.5"
8
8
  authors = [
9
9
  { name="stephan192", email="stephan192@outlook.com" },
10
10
  ]
@@ -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("https://pegelportal.brandenburg.de/start.php")
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("https://pegelportal.brandenburg.de/start.php")
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\u00A0+/-\u00A0cm]")
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("\u00A0\u00A0\u00A0 um") + 6 : text.find("Trend")
64
+ text.find("\u00a0\u00a0\u00a0 um") + 6 : text.find("Trend")
65
65
  ].strip(),
66
66
  "%d.%m.%Y %H:%M",
67
67
  )
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