CLI tool for extracting and working with CAMELS-CH hydrological data
Project description
camelsch
CLI tool for downloading, exploring, and extracting data from the CAMELS-CH hydrological dataset (331 Swiss basins, 1981-2020).
Maintenance Status
🟢 Active – Maintained by hydrosolutions
Installation
pip install camelsch
This also works inside conda/mamba environments — just activate yours first.
If you use uv for project management:
uv add camelsch
Workflow
camelsch follows a download-then-query workflow:
- Download the CAMELS-CH dataset once from Zenodo (~1.5 GB).
- Explore the dataset — list basins, check available variables, view summaries.
- Extract the data you need — filter by basin, variable, and date range, then export to CSV or Parquet.
All commands read from a local data directory (default ./data/CAMELS_CH). You can change it with --data-dir or the CAMELSCH_DATA_DIR environment variable.
Quick start
# Step 1: Download the dataset from Zenodo (~1.5 GB)
camelsch download
# Step 2: Explore — show dataset summary
camelsch info
# List all basin IDs
camelsch basins
camelsch basins --format json
camelsch basins --format csv --attrs area,p_mean
# Step 3: Extract data
# Static catchment attributes
camelsch attributes --basins 2004,2007 --output attrs.csv
# Time series with filtering
camelsch timeseries --basins 2004 --vars precipitation,discharge_spec \
--start 1990-01-01 --end 2000-12-31 --output ts.csv
# Batch export to Parquet (with optional attribute merge)
camelsch export --include-attrs --output camels_ch.parquet
Python API
import camelsch
# Load static attributes for specific basins
attrs = camelsch.load_attributes("./data/CAMELS_CH", basin_ids=["2004", "2007"])
# Load time series with filtering
data = camelsch.load_timeseries(
"./data/CAMELS_CH",
basin_ids=["2004"],
variables=["precipitation", "discharge_spec"],
start_date="1990-01-01",
end_date="2000-12-31",
)
# List available basins and variables
basins = camelsch.list_basins("./data/CAMELS_CH")
variables = camelsch.list_variables("./data/CAMELS_CH")
Data reference
CAMELS-CH provides daily hydrometeorological time series and static catchment attributes for 331 Swiss basins (1981-2020). The dataset contains 21 time series variables:
Observation-based (9 variables)
| Variable | Description |
|---|---|
discharge_vol |
Discharge volume (m³/s) |
discharge_spec |
Specific discharge (mm/d) |
waterlevel |
Water level (m) |
precipitation |
Basin-mean daily precipitation (mm/d) |
temperature_min |
Minimum daily temperature (°C) |
temperature_mean |
Mean daily temperature (°C) |
temperature_max |
Maximum daily temperature (°C) |
rel_sun_dur |
Relative sunshine duration (%) |
swe |
Snow water equivalent (mm) |
Simulation-based (12 variables)
| Variable | Description |
|---|---|
discharge_vol_sim |
Simulated discharge volume (m³/s) |
discharge_spec_sim |
Simulated specific discharge (mm/d) |
precipitation_sim |
Simulated precipitation (mm/d) |
temperature_sim |
Simulated temperature (°C) |
radiation_sim |
Simulated radiation (W/m²) |
sun_duration_sim |
Simulated sunshine duration (h) |
wind_sim |
Simulated wind speed (m/s) |
rel_humidity_sim |
Simulated relative humidity (%) |
pet_sim |
Simulated potential evapotranspiration (mm/d) |
et_sim |
Simulated actual evapotranspiration (mm/d) |
intercept_et_sim |
Simulated interception evapotranspiration (mm/d) |
intercept_storage_sim |
Simulated interception storage (mm) |
Convenience aliases: pet → pet_sim, et → et_sim.
Static attributes cover topography (area, elev_mean), climate (p_mean, t_mean), land cover, soil, and geology.
Full dataset: CAMELS-CH on Zenodo Reference paper: Hoege et al. (2023), CAMELS-CH: hydro-meteorological time series and landscape attributes for 331 catchments in hydrologic Switzerland, Earth Syst. Sci. Data.
For developers
# Install dependencies
uv sync
# Run tests
uv run pytest
# Lint and format
uv run ruff check src/ tests/
uv run ruff format src/ tests/
# Type check
uv run mypy src/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file camelsch-0.3.0.tar.gz.
File metadata
- Download URL: camelsch-0.3.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd6e3c414ca9cafe959ec9175205c94bc6c04003ddf4fee8a1524f99919a5f6a
|
|
| MD5 |
020a47b331c2397c07428a7689129307
|
|
| BLAKE2b-256 |
b129fecc6340ff97538805826d8bd25288088971521faa41f198bdebf7675cf5
|
Provenance
The following attestation bundles were made for camelsch-0.3.0.tar.gz:
Publisher:
release.yml on hydrosolutions/camelsch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
camelsch-0.3.0.tar.gz -
Subject digest:
bd6e3c414ca9cafe959ec9175205c94bc6c04003ddf4fee8a1524f99919a5f6a - Sigstore transparency entry: 1175497001
- Sigstore integration time:
-
Permalink:
hydrosolutions/camelsch@09677b74af73190005bf666c22f8a32aff1f831b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/hydrosolutions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@09677b74af73190005bf666c22f8a32aff1f831b -
Trigger Event:
release
-
Statement type:
File details
Details for the file camelsch-0.3.0-py3-none-any.whl.
File metadata
- Download URL: camelsch-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53ca4b098de2dfddbd0a0861482b27973809e3ea0800f7d3a0fa2ffcb15806e9
|
|
| MD5 |
7c9f4b8420b6b18a86194359f289058f
|
|
| BLAKE2b-256 |
78bdd6caa6291fbcebc0dd13279b6d59391eeddc33b1f0664369722988785be2
|
Provenance
The following attestation bundles were made for camelsch-0.3.0-py3-none-any.whl:
Publisher:
release.yml on hydrosolutions/camelsch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
camelsch-0.3.0-py3-none-any.whl -
Subject digest:
53ca4b098de2dfddbd0a0861482b27973809e3ea0800f7d3a0fa2ffcb15806e9 - Sigstore transparency entry: 1175497002
- Sigstore integration time:
-
Permalink:
hydrosolutions/camelsch@09677b74af73190005bf666c22f8a32aff1f831b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/hydrosolutions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@09677b74af73190005bf666c22f8a32aff1f831b -
Trigger Event:
release
-
Statement type: