Skip to main content

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: 27.7M lithology intervals, 9.28M wells, 48 states (as of 2026-09-29; sg.groundwater_summary() returns the live totals)
sg.groundwater_at(42.73, -84.55)      # nearest well + lithology log (needs an API key: SWATGENX_API_KEY)
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.

Plans and access

These data functions need no account: catalog(), calibration(), groundwater_summary(), pfas_stations(), pfas_summary() and access_info(). Well records (groundwater_at(), or Client.groundwater_at()) need a free account's API key, and so do ordering and downloading models, within your plan's allocation; cloud calibration is paid from account credit. The plans and what each includes are at swatgenx.com/pricing, and sg.access_info() returns them live from the API. Quota and plan errors raise SwatGenXError with the next step.

AI agents

The same platform is agent-native via a public MCP server: https://www.swatgenx.com/mcp (see the site's llms.txt). Every call needs a SWATGenX sign-in or an API key. From 15 October 2026, agent access to the model, data and order tools is part of the paid plans (Starter, MAX or Department); four tools stay open to any account (search_docs, get_doc, get_access_info and get_engine_info). This package calls the REST API, which that date does not change: the public data functions need no account, and model orders use the same fair-use allocation as the web application.

Data citations

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

Metadata

Release files for swatgenx 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swatgenx 0.1.2
File Size Uploaded
swatgenx-0.1.2.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swatgenx 0.1.2
File Interpreter ABI Platform
swatgenx-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.5 kB

Release files / swatgenx-0.1.2.tar.gz

Download URL swatgenx-0.1.2.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
43892655bc076b16eb760e9774368ce0c693ce3da4bc187f40b23a0a1a8d6d30
BLAKE2b-256 checksum
How to use checksums
6d26be95dc7a54323e42ed11ac98e00ba5b518a2cf32bdecbea1ff64ab08eeea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / swatgenx-0.1.2-py3-none-any.whl

Download URL swatgenx-0.1.2-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
976f1bc3316639336a53bac44906cd18c3c96ff5546e45aea83648a571f659bb
BLAKE2b-256 checksum
How to use checksums
0172b26ceeddc9bd1655c4165c6ba61b575200a9566fd8c3c98f931d42ba336d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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