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 17 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, flow_variability, high_q_freq, high_q_dur, low_q_freq, low_q_dur, zero_q_freq, hfd_mean, half_flow_date_std

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 1.0.4

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 1.0.4
File Size Uploaded Provenance Actions
camels_attrs-1.0.4.tar.gz 48.7 kB Without provenance Details for camels_attrs-1.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 91.6 kB

Release files / camels_attrs-1.0.4.tar.gz

Download URL camels_attrs-1.0.4.tar.gz
Size 48.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c9e5877ed301f5acd60abcfecb1b9744d67482412cf2e3f8b655b4222c3a9820
BLAKE2b-256 checksum
How to use checksums
33f8b6a0adc1aee4acacb16b68f86e8b25cbdc5116999163e214cdde2019740f
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-1.0.4-py3-none-any.whl

Download URL camels_attrs-1.0.4-py3-none-any.whl
Size 42.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2a92640f0ce420511d3c1b5b6d87fad55832c8491ae0f3031f093b32e836f28
BLAKE2b-256 checksum
How to use checksums
7423b8b6816dfcc2356e6cf845eb0202a118be268459cae1b357f82653116a42
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 1.0.4

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