Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python Wrapper for SWMM5 API

Project Description

Python Wrapper for Stormwater Management Model (SWMM5)


Build status

Project information

YouTube Examples

Stream Results and Adjust Weir Setting


PySWMM is a Python language software package for the creation, manipulation, and study of the structure, dynamics, and function of complex networks.

With PySWMM you can load and manipulate USEPA Stormwater Management Models. With the development of PySWMM, control algorithms can now be developed exclusively in Python which allows the use of functions and objects as well as storing and tracking hydraulic trends for control actions.

Who uses PySWMM?

PySWMM is used by engineers, modelers, and researchers who want to streamline stormwater modeling optimization, controls, and post-processing results.


PySWMM is intended to provide

  • tools for the study of the structure and dynamics within USEPA SWMM5,
  • a standard programming interface and graph implementation that is suitable for many applications,
  • a rapid development environment for collaborative, multidisciplinary projects,
  • an interface to USEPA SWMM5,
  • development and implementation of control logic outside of native EPA-SWMM Controls,
  • methods for users to establish their own node inflows,
  • a coding interface to binary output files,
  • new modeling possibilities for the SWMM5 Community.


Get the latest version of PySWMM from

$ pip install pyswmm

To get the git version do

$ git clone


A quick example that steps through a simulation:


Intialize using with statement. This automatically cleans up after a simulation

>>> from pyswmm import Simulation
>>> with Simulation('model.inp') as sim:
...     for ind in sim:
...         pass

Initialize the simulation and execute. This style does not allow the user to interact with the simulation. However, this approach tends to be the fastest.

>>> from pyswmm import Simulation
>>> sim = Simulation('model.inp')
>>> sim.execute()

Intialize a simulation and iterate through a simulation. This approach requires some clean up.

>>> from pyswmm import Simulation
>>> sim = Simulation('model.inp')
>>> for ind in sim:
...     pass
>>> sim.close()


Our issue tracker is at Please report any bugs that you find. Or, even better, fork the repository on GitHub and create a pull request. All changes are welcome, big or small, and we will help you make the pull request if you are new to git (just ask on the issue).


Distributed with a BSD2 license; see LICENSE.txt:

Copyright (C) 2014 PySWMM Developers
Bryant E. McDonnell <>

Powered By

EmNet LLC:
Open Storm:


  • Tim Cera
  • Assela Pathirana

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(615.9 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Jan 8, 2018

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting