Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.5 (2025-05-24)
### Fixed
- Fix BB encoding

## 1.0.4 (2024-12-24)
### Fixed
- Fix NI invalid values
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 stephan192
Copyright (c) 2025 stephan192

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion docs/update_pegel_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def fix_bb_encoding(string_in: str) -> str:
def get_bb_stations() -> tuple[str, str]:
"""Get all available stations for Brandenburg."""
stations = []
page = fetch_text("https://pegelportal.brandenburg.de/start.php")
page = fetch_text(
"https://pegelportal.brandenburg.de/start.php", forced_encoding="ISO-8859-15"
)
lines = page.split("\n")
start_found = False
for line in lines:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "lhpapi"
version = "1.0.4"
version = "1.0.5"
authors = [
{ name="stephan192", email="stephan192@outlook.com" },
]
Expand Down
10 changes: 8 additions & 2 deletions src/lhpapi/bb_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ def init_BB(ident: str) -> StaticData: # pylint: disable=invalid-name
"""Init data for Brandenburg."""
try:
# Get data
page = fetch_text("https://pegelportal.brandenburg.de/start.php")
page = fetch_text(
"https://pegelportal.brandenburg.de/start.php",
forced_encoding="ISO-8859-15",
)
lines = page.split("\n")
# Parse data
start_found = False
Expand Down Expand Up @@ -105,7 +108,10 @@ def update_BB(static_data: StaticData) -> DynamicData: # pylint: disable=invali
"""Update data for Brandenburg."""
try:
# Get data
page = fetch_text("https://pegelportal.brandenburg.de/start.php")
page = fetch_text(
"https://pegelportal.brandenburg.de/start.php",
forced_encoding="ISO-8859-15",
)
lines = page.split("\n")
# Parse data
start_found = False
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lhpapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
MAX_STAGE = 4

testdata = [
("BB_5804300", "Ketzin / Havel", True, True, True),
("BB_6602200", "Klein Bademeusel / Lausitzer Neiße", True, True, True),
("BE_5866301", "Zoo / Landwehrkanal", True, False, True),
("BW_00102", "Rottenburg / Bronnbachquelle", True, True, True),
("BY_16005701", "München / Isar", True, True, True),
Expand Down