Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

HydroServer Python Client

The hydroserverpy Python package provides an interface for managing HydroServer data and metadata, loading observations, and performing data quality control. This guide will go over how to install the package and connect to a HydroServer instance. Full hydroserverpy documentation and examples can be found here.

Installation

You can install the package via pip:

pip install hydroserverpy

Connecting to HydroServer

To connect to HydroServer, you need to initialize the client with the instance of HydroServer you're using and your user credentials if you want to access and modify your own data. If you don't provide authentication credentials you can read public data, but you will not be able to create or modify any data.

Example: Anonymous User

from hydroserverpy import HydroServer

# Initialize HydroServer connection.
hs_api = HydroServer(
    host='https://playground.hydroserver.org'
)

Example: Basic Authentication

from hydroserverpy import HydroServer

# Initialize HydroServer connection with credentials.
hs_api = HydroServer(
    host='https://playground.hydroserver.org',
    email='user@example.com',
    password='******'
)

Example: API Key Authentication

from hydroserverpy import HydroServer

hs_api = HydroServer(
    host='https://playground.hydroserver.org',
    apikey='hs_your_api_key'
)

Example: OIDC Access Token Authentication

Applications that sign users in through HydroServer's OpenID Connect provider can act on the user's behalf with the access token they received:

from hydroserverpy import HydroServer

hs_api = HydroServer(
    host='https://playground.hydroserver.org',
    access_token='your_access_token'
)

Access tokens expire, so you can pass a function instead of a string. It is called before every request, so it can return a refreshed token when the current one has expired. For example, with a token stored by python-social-auth:

from social_django.utils import load_strategy

def get_access_token():
    social = user.social_auth.get(provider='oidc')
    if social.access_token_expired():
        social.refresh_token(load_strategy())
    return social.extra_data['access_token']

hs_api = HydroServer(
    host='https://playground.hydroserver.org',
    access_token=get_access_token
)

The token must carry the scopes for the operations you perform, for example data:read to read monitoring sites, datastreams, and observations, data:write to change them, and workspace:read to list workspaces. Requests made without a required scope fail with a 403 error that names the missing scope.

Funding and Acknowledgements

Funding for this project was provided by the National Oceanic & Atmospheric Administration (NOAA), awarded to the Cooperative Institute for Research to Operations in Hydrology (CIROH) through the NOAA Cooperative Agreement with The University of Alabama (NA22NWS4320003). Utah State University is a founding member of CIROH and receives funding under subaward from the University of Alabama. Additional funding and support have been provided by the State of Utah Division of Water Rights, the World Meteorological Organization, and the Utah Water Research laboratory at Utah State University.

Metadata

Release files for hydroserverpy 2.0.0b10

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

Source distribution (sdist)

Source distribution for hydroserverpy 2.0.0b10
File Size Uploaded Provenance Actions
hydroserverpy-2.0.0b10.tar.gz 78.3 kB Without provenance Details for hydroserverpy-2.0.0b10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hydroserverpy 2.0.0b10
File Interpreter ABI Platform Actions
hydroserverpy-2.0.0b10-py3-none-any.whl Python 3 none any Details for hydroserverpy-2.0.0b10-py3-none-any.whl

Total release size: 196.6 kB

Release files / hydroserverpy-2.0.0b10.tar.gz

Download URL hydroserverpy-2.0.0b10.tar.gz
Size 78.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7dd7865c7a6c2f4a4369d87fe47003d74ddac6b978d2cb24b098251621983eca
BLAKE2b-256 checksum
How to use checksums
18fff344e9bd95ecb8808e45649f944f3ffe14208637628f8a4338d29054cef6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / hydroserverpy-2.0.0b10-py3-none-any.whl

Download URL hydroserverpy-2.0.0b10-py3-none-any.whl
Size 118.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b66aaf867bf0db92dd4d72ec26e4b541570f1843e8857dc5dda26170a42a686c
BLAKE2b-256 checksum
How to use checksums
42c71daa5a4c5dba9800893c0386e550ad88ecf7d8ad339a349aaeb918748f49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for hydroserverpy 2.0.0b10

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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