swmm-toolkit contains SWIG generated Python wrappers for the swmm-solver and swmm-output libraries.
pip install swmm-toolkit
Join the discussion! We will do everything we can to help you!
swmm-toolkit makes SWMM a fully fledged Python extension with:
- Compatibility with USEPA SWMM
- Python integration at the speed of C
- Full access to library APIs
- Pythonic naming, enums, exceptions, and return value handling
Run a SWMM simulation.
from swmm.toolkit import solver
solver.run('input_file.inp', 'report_file.rpt', 'output_file.out')
Note
Since version version 0.16.1, swmm-toolkit by default has been built and published using the python stable ABI for python 3.9 onward. Using the stable ABI introduces very minor performance reduction while substantially simplifying our release process and compatibility with future python versions.
The commands below show how to build this package with and without using the python stable ABI.
python -m build .
NO_STABLE_ABI=1 python -m build