Skip to main content

Running and calibrating default or custom SWAT+ projects with Python

Project description

pySWATPlus

DOI PyPI - Version PyPI - Python Version PyPI - Status

flake8 mypy pytest codecov

GitHub last commit GitHub commit activity GitHub Repo stars GitHub forks GitHub Created At

Read the Docs Pepy Total Downloads PyPI - License

📦 About

pySWATPlus is an open-source Python package developed and maintained by ICRA. It provides a programmatic interface to the SWAT+ model, allowing users to run simulations, modify input files, and streamline custom experimentation through the model’s TxtInOut folder.

✨ Key Features

  • Navigate and read files in the SWAT+ TxtInOut folder.
  • Modify input parameters and save the updated files.
  • Run SWAT+ simulations either in the main TxtInOut folder or in a user-specified directory.
  • Perform sensitivity analysis on model parameters using SALib, with support for parallel computation.

📥 Install pySWATPlus

To install from PyPI repository:

pip install pySWATPlus

To install the latest development version from GitHub:

pip install git+https://github.com/swat-model/pySWATPlus.git

To install from source in editable mode within your desired conda environment:

# Activate your Conda environment
conda activate <environment_name>

# Install required tools and clone the repository
pip install build
cd C:\Users\Username\Folder  # Replace with your actual path
git clone https://github.com/swat-model/pySWATPlus.git
cd pySWATPlus

# Build the package
python -m build

# Install in editable mode
pip install --editable .

🚀 Quickstart

A brief example of how to start:

import pySWATPlus
txtinout = pySWATPlus.TxtinoutReader(
    path=r"C:\Users\Username\TxtInOut" # Replace with your actual path
)

📚 Documentation

For a guide to setting up first SWAT+ project and other functionalities with examples, refere to the pySWATPlus documentation.

⚠️ Legacy Version Notice

Version 1.x includes breaking changes, including the SWATProblem and SWATProblemMultimodel classes have been removed. Updated tutorials for calibration analysis are coming soon.

  • To get the old 0.x version from the PyPI repository:
pip install pySWATPlus==0.2.20

📖 Citation

If you use pySWATPlus in your research or project, please cite the specific version you used. For general citation of the project (which always points to the latest version), use the concept DOI provided below.


🔹 Citing a Specific Version

Each release of pySWATPlus is archived on Zenodo with its own DOI. To cite a specific version:

  1. Visit the Zenodo project page: https://doi.org/10.5281/zenodo.14889319
  2. Under Versions, click the release you used (e.g., v1.0.1)
  3. Copy the citation format provided there (BibTeX, APA, etc.)

🔹 Citing the Latest Version (Concept DOI)

To cite the most recent version (not tied to a specific release):

@software{joan_salo_pyswatplus_latest,
  author       = {Joan Saló and
                  Debasish Pal and
                  Oliu Llorente},
  title        = {swat-model/pySWATPlus},
  year         = 2025,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.14889319},
  url          = {https://doi.org/10.5281/zenodo.14889319},
  note         = {This DOI always points to the latest version of pySWATPlus.},
}

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

pyswatplus-1.0.3.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

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

pyswatplus-1.0.3-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pyswatplus-1.0.3.tar.gz.

File metadata

  • Download URL: pyswatplus-1.0.3.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pyswatplus-1.0.3.tar.gz
Algorithm Hash digest
SHA256 50e921dacfc2f55ce8e36b932454441f06c0972c171062b4005080d647ca693a
MD5 430414f82cd3e87e000210cd9eb1a821
BLAKE2b-256 6db0c136a964440f4e08e5a5822708bfa2c30c570d8ae7377c8ad8acb38b253b

See more details on using hashes here.

File details

Details for the file pyswatplus-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyswatplus-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pyswatplus-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8922e4cb8cd52b1fc8901aad94fd29e2cb21506d97d16b90024b10d16397d1e1
MD5 78d333fc8c35e49e81f302dfd290e273
BLAKE2b-256 a4d8fd9cb048c1285489653a645fe6607496f616245554083c403d67a9f35d42

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