Skip to main content

CLI tool for extracting and working with CAMELS-CH hydrological data

Project description

camelsch

CI Python 3.10+ Binder

CLI tool for downloading, exploring, and extracting data from the CAMELS-CH hydrological dataset (331 Swiss basins, 1981-2020).

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:

  1. Download the CAMELS-CH dataset once from Zenodo (~1.5 GB).
  2. Explore the dataset — list basins, check available variables, view summaries.
  3. 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). Key variables include:

Variable Description
precipitation Basin-mean daily precipitation (mm/d)
temperature Basin-mean daily temperature (deg C)
discharge_spec Observed specific discharge (mm/d)
discharge_spec_sim Simulated specific discharge (mm/d)
pet / pet_sim Potential evapotranspiration (mm/d)
et / et_sim Actual evapotranspiration (mm/d)
snow_water_eq_sim Simulated snow water equivalent (mm)

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


Download files

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

Source Distribution

camelsch-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

camelsch-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file camelsch-0.1.0.tar.gz.

File metadata

  • Download URL: camelsch-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for camelsch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 03469c90cd201e31f1f1ed1ca14570a5969e9f25736f9334fa3226a0739713a1
MD5 85604ba4d612ddb37ccf3ff3a6f92c2d
BLAKE2b-256 1088a936ae80a70364ff371f2f8f82a0fc119b683919841f79069f96d2891847

See more details on using hashes here.

Provenance

The following attestation bundles were made for camelsch-0.1.0.tar.gz:

Publisher: release.yml on hydrosolutions/camelsch

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

File details

Details for the file camelsch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: camelsch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for camelsch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42a6f1e215a423eff30b2671dc920fae53c19cab13a2ba144887e2039c595e95
MD5 8f47117c0a1fe7afffd126beb2e6c4ce
BLAKE2b-256 eafedac8d45a9ac7856ee42b1f2aaf5a1a1c9338149d563b45643f92cbf84588

See more details on using hashes here.

Provenance

The following attestation bundles were made for camelsch-0.1.0-py3-none-any.whl:

Publisher: release.yml on hydrosolutions/camelsch

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