No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Till Wesselmann 24bcc89659 Reformat code with longer line length
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 07:38:25 +01:00
oberkante Reformat code with longer line length 2026-02-27 07:38:25 +01:00
tests Reformat code with longer line length 2026-02-27 07:38:25 +01:00
.gitignore Initial commit 2022-02-02 17:05:12 +01:00
.gitlab-ci.yml Add coordinate parsing, expanded input types, and modernize packaging 2026-02-23 16:27:51 +01:00
LICENSE Add LICENSE 2022-02-02 16:07:06 +00:00
pyproject.toml Add coordinate parsing, expanded input types, and modernize packaging 2026-02-23 16:27:51 +01:00
README.md Add coordinate parsing, expanded input types, and modernize packaging 2026-02-23 16:27:51 +01:00

Oberkante

Oberkante parses E-Format tide data published by the German Federal Maritime and Hydrographic Agency (BSH).

Source data can be downloaded from the BSH Filebox (the previous Tableau download page links to the same files).

Features

  • Parses BSH E-Format header (metadata) and data lines (tide events)
  • Accepts Path, str, BytesIO, or any IOBase as input
  • Extracts gauge coordinates (latitude, longitude) from header field A08
  • Extracts PNP-below-NHN offset from header field D01

Usage

from pathlib import Path
from oberkante import BSHTideParser

parser = BSHTideParser(Path("tide_data.txt"))
result = parser.parse()

# Metadata
print(result.gauge_name)      # e.g. "Cuxhaven, Steubenhöft, Elbe"
print(result.year)             # e.g. 2022
print(result.latitude)         # e.g. 53.867778
print(result.longitude)        # e.g. 8.7175
print(result.pnp_below_nhn)   # e.g. -5.02

# Tide events
for entry in result.entries:
    print(entry.timestamp, entry.event_type, entry.height)

You can also parse from a string or bytes stream:

from io import BytesIO
from oberkante import BSHTideParser

# From string
parser = BSHTideParser(raw_text)
result = parser.parse()

# From BytesIO
parser = BSHTideParser(BytesIO(raw_bytes))
result = parser.parse()