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.6.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.6.0
File Size Uploaded Provenance
sgu_client-0.6.0.tar.gz 27.5 kB With provenance Details

Built distribution (wheel)

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

Total release size: 65.7 kB

Release files / sgu_client-0.6.0.tar.gz

Download URL sgu_client-0.6.0.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f045ecb788967fe656219696a517e4a868081867c839d6690103a164d88dc31f
BLAKE2b-256 checksum
How to use checksums
beccbd51710010506f2ee9e153b14633fd4ff412e59e8a24684ba1d8fe67f24d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

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

Download URL sgu_client-0.6.0-py3-none-any.whl
Size 38.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f025b8aea108bab8f4518c8e9b641d64add0d77effbafc13150d7c7d6a764822
BLAKE2b-256 checksum
How to use checksums
ec3ee3c6b654a0a6b1292603fabaca44cc5cf0a9e004834a864fcdbe9e81fbf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

Security for sgu-client 0.6.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.6.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 19, 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