Skip to main content

Near-real-time readings from Hamburg's water quality network (WGMN) via the public Wassergüte-Auskunft.

Project description

fluvilog

CI PyPI

Near-real-time readings from Hamburg's water-quality network (WGMN), via the public Service Portal service.

By default it runs as a continuous service that polls and stores readings into SQLite. A one-shot mode prints the latest values as a table instead, and an optional HTTP API serves the stored data.

Requirements

  • Python 3.13
  • uv (recommended to make use of provided configuration and dependency lockfile)

Getting started

uv sync --extra api     # api extra is optional, needed only for `serve-api` mode

Without uv: python -m venv .venv && .venv/bin/pip install -e . (add '.[api]' for the HTTP API).

Once installed:

uv run fluvilog list    # list stations (no egress here)
uv run fluvilog once    # one-shot fetch and print
uv run fluvilog         # Continuously fetch and store (default metrics, all stations)

Bare fluvilog (no subcommand) runs collect. A single fetch cycle takes ~30–50 s — this is due to the way the data is provided, not an issue with your network or the code.

Configuration arguments are provided to select specific stations, metrics, configure fetch intervals and more. fluvilog --help to your rescue.

Configuration

Every relevant flag has a FLUVILOG_* environment-variable equivalent. A flag overrides the environment, which overrides the built-in default.

Variable Flag Default
FLUVILOG_DB --db fluvilog.db
FLUVILOG_INTERVAL --interval 600 (seconds; accepts s/m/h suffix)
FLUVILOG_STATION --station all stations (comma-separated codes or names)
FLUVILOG_API_HOST --host 127.0.0.1
FLUVILOG_API_PORT --port 8000
FLUVILOG_CORS_ORIGIN --cors-origin none (comma-separated origins)

HTTP API (optional)

Install the [api] extra, then:

uv run fluvilog serve-api --db water.db --cors-origin http://localhost:5173

The API opens the database read-only per request, so it can run concurrently with collect (the single writer) under SQLite WAL. Endpoints:

  • GET /api/stations — station catalogue with WGS84 coordinates
  • GET /api/readings/latest?station=&parameter= — latest reading per series
  • GET /api/readings?from=&to=&station=&parameter= — readings in a window (≤30 days)

Data source

The Wassergüte-Auskunft limits each request to ≤5 stations and ≤5 parameters (otherwise it silently truncates), so fetches are batched around that. Readings arrive at a 10-minute cadence and are stored idempotently, keyed on (station, parameter, timestamp), so the poll interval is decoupled from the source cadence.

Docker

Released images are published to GHCR:

docker run -v "$PWD/data:/data" ghcr.io/dmnq-f/fluvilog   # collect into /data/fluvilog.db

Or build locally:

docker build -t fluvilog .
docker run -v "$PWD/data:/data" fluvilog

To run collect and the HTTP API together against a shared database, see examples/compose.yaml:

docker compose -f examples/compose.yaml up -d   # collect (writer) + serve-api on http://localhost:8000

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fluvilog-0.2.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fluvilog-0.2.0-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file fluvilog-0.2.0.tar.gz.

File metadata

  • Download URL: fluvilog-0.2.0.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for fluvilog-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3f01bf6706631cd5dcc0667c144c89ad1f0218565cba2e7555af9c4afc560b7e
MD5 3993841fc4e71ed51d4497396270abe5
BLAKE2b-256 e8ec7cf7e66c8f1cb01bad9fe7046342441c0311764de5b53c233a1b8f779b0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluvilog-0.2.0.tar.gz:

Publisher: release.yml on dmnq-f/fluvilog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fluvilog-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fluvilog-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for fluvilog-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfd173328ba5362fc7e6947cf1bb44fc88567b5ace1cc52c4a64042ae1aea876
MD5 088ae4ed8dfc4fbe535447c1b92fe8e3
BLAKE2b-256 86acf679b4c7f4e7ebd79274c9d232cb47f5941d274174436b25570ca5492c15

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluvilog-0.2.0-py3-none-any.whl:

Publisher: release.yml on dmnq-f/fluvilog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page