Skip to main content

CAMELS Attrs

CAMELS Attrs

PyPI version License: MIT Downloads CI

A Python package for extracting CAMELS-like catchment attributes and hydrometeorological timeseries for any USGS gauge in the United States.

Key Capabilities

  • Automated Attribute Extraction: Extract 60+ catchment attributes following CAMELS methodology
  • Watershed Delineation: Automatic watershed boundary extraction for any USGS gauge
  • Timeseries Data: Fetch daily hydrometeorological forcing data (precipitation, temperature, PET, etc.)
  • Batch Processing: Process multiple gauges simultaneously
  • Visualization: Create publication-ready watershed maps
  • CLI & Python API: Use via command-line or integrate into Python workflows

Installation

pip install camels-attrs

Quick Start

Command Line

# Extract all attributes for a gauge
camels-extract 01031500 -o attributes.csv

# Extract multiple gauges
camels-extract 01031500 02177000 06803530 -o combined.csv

# Include timeseries data
camels-extract 01031500 --timeseries -o data.csv

# Custom date ranges
camels-extract 01031500 --climate-start 2010-01-01 --climate-end 2020-12-31

Python API

from camels_attrs import CamelsExtractor

# Single gauge extraction
extractor = CamelsExtractor('01031500')
attributes = extractor.extract_all()

# Save to file
extractor.save('attributes.csv')

# Extract timeseries
forcing_data = extractor.extract_timeseries(
    start_date='2010-01-01',
    end_date='2020-12-31'
)

# Create watershed map
extractor.create_comprehensive_map(save_path='watershed_map.png')
from camels_attrs import extract_multiple_gauges

# Batch processing
gauge_list = ['01031500', '02177000', '06803530']
df = extract_multiple_gauges(
    gauge_list,
    climate_start='2010-01-01',
    climate_end='2020-12-31'
)
df.to_csv('batch_attributes.csv')

Extracted Attributes (60+)

Category Count Examples
Topographic 7 Elevation statistics, slope, drainage area
Climate 13 Precipitation, temperature, aridity, seasonality, extremes
Soil 9 Texture, depth, porosity, conductivity, water content
Vegetation 13 LAI, NDVI/GVF, land cover fractions, root depth
Geological 7 Lithology fractions, porosity, permeability
Hydrological 18 Flow statistics, baseflow, runoff ratio, event characteristics
View complete attribute list

Topographic

gauge_lat, gauge_lon, elev_mean, elev_min, elev_max, slope_mean, area_gages2, aspect statistics

Climate

p_mean, pet_mean, aridity, p_seasonality, frac_snow, temperature statistics, high_prec_freq, high_prec_dur, low_prec_freq, low_prec_dur

Soil

Sand/silt/clay fractions, soil_depth_pelletier, soil_depth_statsgo, soil_porosity, soil_conductivity, water content, bulk density, organic carbon

Vegetation

lai_max, lai_diff, gvf_max, gvf_diff, ndvi_max, ndvi_diff, land cover fractions, dom_land_cover, dom_land_cover_frac

Geology

Lithology fractions (siliciclastic, carbonate, etc.), geol_porosity, geol_permeability

Hydrology

q_mean, runoff_ratio, baseflow_index, stream_elas, slope_fdc, slope_fdc_sawicz2011, flow_variability, high_q_freq, high_q_dur, low_q_freq, low_q_dur, zero_q_freq, hfd_mean, half_flow_date_std

Definitions (2.0.0). slope_fdc is the CAMELS-US v1.2 file definition, (Q66 - Q33) / (mean(q) * 0.33) (non-exceedance type-7 quantiles, zero-flow days kept; reproduces the file to 1e-6). The log-space value that slope_fdc reported in 1.x is slope_fdc_sawicz2011. baseflow_index uses the Ladson et al. (2013) Lyne-Hollick recipe CAMELS applied (reproduces the file to 1e-5). high_q_freq and low_q_freq are days/yr; zero_q_freq is the fraction of days with q <= 0. camels_attrs.hydrology.SIGNATURE_DEFINITIONS carries the formula, quantile type, zero handling and source of each. Values from 1.x are not comparable for slope_fdc and baseflow_index; see the CHANGELOG.

Known limitation. Climate (GridMET precipitation, pygridmet) and Daymet (pydaymet) are called without response validation and outside the aihydro-data layer's calendar/cache checks. A silently incomplete or mis-dated climate record can reach runoff_ratio, stream_elas and the climate attributes. Not fixed here; the validated data path lives in aihydro-data (0.2.5).

Data Sources

Data Type Source Resolution
Watershed Boundaries USGS NLDI Vector
Topography USGS 3DEP 10m-30m DEM
Climate GridMET 4km daily
Soil gNATSGO, POLARIS 30m-90m
Vegetation MODIS, NLCD 250m-30m
Geology GLiM, GLHYMPS Vector
Streamflow USGS NWIS Daily

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/

# With coverage
pytest tests/ --cov=camels_attrs

Citation

If you use this package in your research, please cite:

Galib, M., & Merwade, V. (2025). camels-attrs: A Python Package for Extracting 
CAMELS-like Catchment Attributes (v1.0.2). Zenodo. 
https://doi.org/10.5281/zenodo.17315038

DOI

References

  • Newman et al. (2015). Development of a large-sample watershed-scale hydrometeorological dataset. NCAR Technical Note
  • Addor et al. (2017). The CAMELS data set: catchment attributes and meteorology for large-sample studies. Hydrology and Earth System Sciences, 21, 5293-5313

Contributing

Contributions are welcome! Please submit a Pull Request or open an Issue.

License

MIT License - see LICENSE file for details.

Contact

Mohammad Galib - mgalib@purdue.edu
Venkatesh Merwade - vmerwade@purdue.edu

Purdue University

Metadata

Release files for camels-attrs 2.0.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 camels-attrs 2.0.0
File Size Uploaded Provenance Actions
camels_attrs-2.0.0.tar.gz 56.2 kB Without provenance Details for camels_attrs-2.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 103.8 kB

Release files / camels_attrs-2.0.0.tar.gz

Download URL camels_attrs-2.0.0.tar.gz
Size 56.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9cc7e608a1d2714f5c28f2a217630d3f9f7b4883c5a97cd53cfa34de7a4e2974
BLAKE2b-256 checksum
How to use checksums
999ec2eb9ded624d4b8b5f2fcede68056bd07a3cb23894d8fa1e8dd04982fc30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / camels_attrs-2.0.0-py3-none-any.whl

Download URL camels_attrs-2.0.0-py3-none-any.whl
Size 47.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b33215d5fed08d033b67334069491e2f9c02219fd1f15110af1ed18c9716563a
BLAKE2b-256 checksum
How to use checksums
faa2618e119c5385a5d91526865e0edacdb097eb3f2bd7021513892244e127f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for camels-attrs 2.0.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.

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.

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