Skip to main content

SGU Client

A modern Python client library for accessing Geological Survey of Sweden (SGU) groundwater data APIs with type safety and pandas integration.

Python Version PyPI version Documentation License: MIT codecov Code style: ruff security: bandit Security Scanning

This package is not affiliated with or endorsed by SGU.

Features

  • Observed and modeled groundwater levels, plus groundwater chemistry
  • Type-safe: full type hints with Pydantic validation
  • Pandas integration: convert responses to DataFrames or Series with optional pandas dependency
  • Friendly shortcuts: look up stations by name, modeled levels by coordinates, and much more

Get going with your analysis in just a few lines of code:

from sgu_client import SGUClient

with SGUClient() as client:
    measurements = client.levels.observed.get_measurements_by_name(station_id="95_2")
    df = measurements.to_dataframe()

# ... rest of your awesome workflow

Installation

uv add sgu-client
# or: pip install sgu-client

# with pandas support for dataframe conversion
uv add "sgu-client[recommended]"
# or: pip install "sgu-client[recommended]"

Documentation

The full documentation lives at officialankan.github.io/sgu-client:

Development

We recommend using uv for development:

git clone https://github.com/officialankan/sgu-client.git
cd sgu-client
uv sync --all-groups --all-extras

uv run pytest
uv run ruff format
uv run ruff check --fix
uv run ty check

Contributions are welcome! Feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Metadata

Release files for sgu-client 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sgu-client 0.7.0
File Size Uploaded Provenance
sgu_client-0.7.0.tar.gz 28.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sgu-client 0.7.0
File Interpreter ABI Platform
sgu_client-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 67.5 kB

Release files / sgu_client-0.7.0.tar.gz

Download URL sgu_client-0.7.0.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bbd1418991f376a425726627fffaa90c5e62c245901607b3f8eb701c146d4bb5
BLAKE2b-256 checksum
How to use checksums
a2d2da5d2f273e1a0c081768bdd6b78697d4157f66f9ddf5dba4d1e9c0f0709c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / sgu_client-0.7.0-py3-none-any.whl

Download URL sgu_client-0.7.0-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8262ab24f1a3bd532dea76120f06eb01c8423c941a906d2a88a4b83a5b1b4b77
BLAKE2b-256 checksum
How to use checksums
27ac9198ab0c9bb41d7bda68be4cf4fcc94b4486b91e06e0d4cbf4579f7bfae8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for sgu-client 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sgu_client-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page