Skip to main content

Python client for SWATGenX — automated SWAT+/MODFLOW watershed models and open national water datasets for the conterminous US

Project description

swatgenx

Public API tests PyPI

Python client for SWATGenX — automated SWAT+ / MODFLOW 6 watershed models and open national water datasets for the conterminous United States.

pip install swatgenx

Public data — no account needed

import swatgenx as sg

# Example-model catalog: built SWAT+ models with calibration/validation metrics
models = sg.catalog(state="FL", calibrated_only=True)
sg.calibration("01451800")
# {'mode': 'engineer', 'cal_daily_nse': 0.642, 'val_daily_nse': 0.748, ...}

# National groundwater inventory: 28.8M lithology intervals, 7.9M wells, 46 states
sg.groundwater_at(42.73, -84.55)      # nearest well + lithology log
sg.groundwater_summary()

# National PFAS monitoring inventory (huc8 = 8-digit hydrologic unit code)
sg.pfas_stations(huc8="04050006")
sg.pfas_summary()

Order and download models — free account + API key

Sign in at swatgenx.com → dashboard → API keys, then:

c = sg.Client(api_key="...")                    # or env SWATGENX_API_KEY

order = c.order(usgs_station="04124500")        # any of 25,000+ USGS gauges
c.wait(order["order_id"])                       # typical build: 20 min – 2 h
c.download("04124500", vpuid="0406", dest="model.zip")   # ZIP straight to your disk

Builds run on SWATGenX cloud infrastructure from national data (NHDPlus HR, 3DEP, gSSURGO, NLCD, PRISM, USGS NWIS); delivery is pull-based — no email round-trip.

Access ladder

tier requires unlocks
guest nothing all public data functions
member free account + API key model orders (fair-use), downloads
extended request via info@swatgenx.com HUC8 whole-basin, SWAT+MODFLOW-6, HUC14 30 m site models
calibration account credit cloud calibration campaigns

sg.access_info() returns this ladder programmatically; quota/tier errors raise SwatGenXError with upgrade guidance.

AI agents

The same platform is agent-native via a public MCP server: https://www.swatgenx.com/mcp (see the site's llms.txt). This package and the MCP server expose the same surface, enforced by the same server-side quotas.

Data citations

MIT-licensed client; platform terms at swatgenx.com.

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

swatgenx-0.1.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

swatgenx-0.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file swatgenx-0.1.1.tar.gz.

File metadata

  • Download URL: swatgenx-0.1.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for swatgenx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4702903d1737a1e090cf40d8a764a9a062329f4b6a91db543346da037873bffa
MD5 d56fa9f9a72d9659e4ff58020eec3170
BLAKE2b-256 6b50aaeb4b2a05bc9741739fb8bc5b6e04ba3feda446b8bb46f72b80df733931

See more details on using hashes here.

File details

Details for the file swatgenx-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: swatgenx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for swatgenx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2229786f350dea328dddbdde5b85b112c5a888e7d066c16f77e783986cc89e35
MD5 e267e8afdb0ae40370fd3e5036b8e616
BLAKE2b-256 6c78f2ee75522e8d882c2726ed871d559c456200e93d48b9239d70087fc57c66

See more details on using hashes here.

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