pyswmm
Python Wrapper for Stormwater Management Model.
https://github.com/pyswmm/pyswmm
Category: Natural Resources
Sub Category: Water Supply and Quality
Keywords
hydraulic-modeling hydrology-stormwater-analysis python stormwater swmm swmm5
Keywords from Contributors
hydraulics hydrology civil-engineering hydroinformatics watershed qt
Last synced: about 11 hours ago
JSON representation
Repository metadata
Python Wrappers for SWMM
- Host: GitHub
- URL: https://github.com/pyswmm/pyswmm
- Owner: pyswmm
- License: other
- Created: 2014-05-12T13:30:03.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2026-11-13T21:16:21.000Z (18 days ago)
- Last Synced: 2026-12-01T01:43:22.372Z (about 10 hours ago)
- Topics: hydraulic-modeling, hydrology-stormwater-analysis, python, stormwater, swmm, swmm5
- Language: Python
- Homepage: https://www.pyswmm.org
- Size: 14.7 MB
- Stars: 386
- Watchers: 29
- Forks: 160
- Open Issues: 14
- Releases: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Citation: CITATION.cff
- Authors: AUTHORS
README.md
python wrappers for the Stormwater Management Model (SWMM5)
Getting started
-
Project Website: www.pyswmm.org
Introducing the SWAG STORE! All Proceeds go toward the hosting/service fees related to maintaining the PySWMM Project!!! Get yourself a hoodie or coffee cup!
🆘Do you need HELP?🆘
GitHub Discussions to answer support questions related to PySWMM.
Cite our Paper
McDonnell, Bryant E., Ratliff, Katherine M., Tryby, Michael E., Wu, Jennifer Jia Xin, & Mullapudi, Abhiram. (2020). PySWMM: The Python Interface to Stormwater Management Model (SWMM). Journal of Open Source Software, 5(52), 2292, https://doi.org/10.21105/joss.02292
YouTube Training Videos
Setting a manhole inflow during a running simulation!
Overview
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.
As of version v1.1.0, PySWMM includes new features to process metadata and timeseries stored in SWMM binary output file.
Who uses PySWMM?
PySWMM is used by engineers, modelers, and researchers who want to streamline stormwater modeling optimization, controls, and post-processing results.
Goals
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.
Install
Get the latest version of PySWMM from PyPI See the Quick Guide!
$ pip install pyswmm
As of version 1.3.1, pyswmm can be installed with specific versions of the SWMM engine ranging from 5.1.14 to 5.2.4 using pip extras:
$ pip install "pyswmm[swmm5.2.4]"
Usage
A quick example that steps through a simulation:
Examples:
See the Latte Example
from pyswmm import Simulation, Nodes, Links
with Simulation(r'Example1.inp') as sim:
Node21 = Nodes(sim)["21"]
print("Invert Elevation: {}". format(Node21.invert_elevation))
Link15 = Links(sim)['15']
print("Outlet Node ID: {}".format(Link15.outlet_node))
# Launch a simulation!
for ind, step in enumerate(sim):
if ind % 100 == 0:
print(sim.current_time,",",round(sim.percent_complete*100),"%",\
Node21.depth, Link15.flow)
Opening a SWMM binary output file and accessing model metadata and timeseries.
from pyswmm import Output, SubcatchSeries, NodeSeries, LinkSeries, SystemSeries
with Output('model.out') as out:
print(len(out.subcatchments))
print(len(out.nodes))
print(len(out.links))
print(out.version)
sub_ts = SubcatchSeries(out)['S1'].runoff_rate
node_ts = NodeSeries(out)['J1'].invert_depth
link_ts = LinkSeries(out)['C2'].flow_rate
sys_ts = SystemSeries(out).rainfall
Contributing
Please check out our Wiki https://github.com/pyswmm/pyswmm/wiki for more information on contributing, including an Author Contribution Checklist.
Bugs
Our issue tracker is at https://github.com/pyswmm/pyswmm/issues. 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).
License
Distributed with a BSD2 license; see LICENSE.txt:
Copyright (C) 2014-2025 (See Authors)
Community-Owned See AUTHORS and CITATION.cff
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "McDonnell" given-names: "Bryant" orcid: "https://orcid.org/0000-0002-6250-2220" - family-names: "Ratliff" given-names: "Katherine" orcid: "https://orcid.org/0000-0003-1410-2756" - family-names: "Tryby" given-names: "Michael" orcid: "https://orcid.org/0000-0000-0000-0000" - family-names: "Wu" given-names: "Jia Xin" orcid: "https://orcid.org/0000-0000-0000-0000" - family-names: "Mullapudi" given-names: "Abhiram" orcid: "https://orcid.org/0000-0000-0000-0000" title: "PySWMM: The Python Interface to Stormwater Management Model (SWMM)" version: 1.0.1 doi: 10.21105/joss.02292 date-released: 2020-08-04 url: "https://github.com/OpenWaterAnalytics/pyswmm"
Owner metadata
- Name: pyswmm
- Login: pyswmm
- Email:
- Kind: organization
- Description:
- Website: https://www.pyswmm.org
- Location: United States of America
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/132501370?v=4
- Repositories: 10
- Last ynced at: 2026-11-30T00:35:05.392Z
- Profile URL: https://github.com/pyswmm
GitHub Events
Total
- Create event: 4
- Delete event: 1
- Discussion event: 1
- Fork event: 13
- Issue comment event: 36
- Issues event: 13
- Pull request event: 13
- Pull request review event: 6
- Push event: 14
- Watch event: 57
Last Year
- Create event: 1
- Discussion event: 1
- Fork event: 5
- Issue comment event: 1
- Pull request event: 1
- Push event: 5
- Watch event: 8
Committers metadata
Last synced: 1 day ago
Total Commits: 821
Total Committers: 25
Avg Commits per committer: 32.84
Development Distribution Score (DDS): 0.56
Commits in past year: 33
Committers in past year: 4
Avg Commits per committer in past year: 8.25
Development Distribution Score (DDS) in past year: 0.364
| Name | Commits | |
|---|---|---|
| Bryant E. McDonnell | b****l@g****m | 361 |
| Jenn Wu | j****u@e****t | 113 |
| Katherine Ratliff | r****e@e****v | 69 |
| karosc | c****s@o****m | 61 |
| Stephen Roberts | s****s@a****u | 50 |
| Gonzalo Pena-Castellanos | g****a@g****m | 50 |
| Michael Tryby | t****l@e****v | 25 |
| bemason | b****n@u****u | 18 |
| Timothy Holmes | t****s@g****m | 14 |
| abhiramm7 | a****m@u****u | 12 |
| jennwuu | j****u@l****m | 12 |
| Damon McDougall | d****l@g****m | 5 |
| karosc | k****c@c****m | 4 |
| Jiada | 3****e | 4 |
| Kristina Macro | k****o@e****t | 3 |
| Ruben Kertesz | r****z@e****t | 3 |
| dependabot[bot] | 4****] | 3 |
| polyedr | i****o@p****m | 3 |
| Charles Lu | 1****s | 3 |
| Caleb | 7****n | 2 |
| James Westover | w****r@p****u | 2 |
| Christian Urich | c****h@g****m | 1 |
| Nick Santos | n****n | 1 |
| unknown | b****l@L****m | 1 |
| dokzai | 3****i | 1 |
Committer domains:
- emnet.net: 3
- umich.edu: 2
- epa.gov: 2
- l-r90338zn.arcadis-us.com: 1
- pas.rochester.edu: 1
- poly-edr.com: 1
- cdmsmith.com: 1
- anu.edu.au: 1
Issue and Pull Request metadata
Last synced: 15 days ago
Total issues: 277
Total pull requests: 162
Average time to close issues: 8 months
Average time to close pull requests: about 1 month
Total issue authors: 119
Total pull request authors: 26
Average comments per issue: 3.66
Average comments per pull request: 2.15
Merged pull request: 139
Bot issues: 0
Bot pull requests: 5
Past year issues: 3
Past year pull requests: 10
Past year average time to close issues: about 2 hours
Past year average time to close pull requests: about 1 month
Past year issue authors: 3
Past year pull request authors: 5
Past year average comments per issue: 1.67
Past year average comments per pull request: 0.6
Past year merged pull request: 8
Past year bot issues: 0
Past year bot pull requests: 4
Top Issue Authors
- bemcdonnell (62)
- goanpeca (26)
- jennwuu (13)
- Jiadalee (7)
- katmratliff (5)
- michaeltryby (5)
- t298 (4)
- tscheuch (4)
- BrianN92 (4)
- lrntct (4)
- Husnain2244 (3)
- jsadler2 (3)
- zxyzmbc1030 (3)
- ghost (3)
- xie-kun (3)
Top Pull Request Authors
- bemcdonnell (67)
- goanpeca (16)
- katmratliff (15)
- karosc (13)
- jennwuu (9)
- dependabot[bot] (5)
- Jiadalee (5)
- abhiramm7 (4)
- michaeltryby (4)
- timothy-holmes (3)
- ghost (3)
- polyedr (3)
- Lu-Charles (2)
- kmmacro (1)
- lrntct (1)
Top Issue Labels
- type:bug (73)
- reso:completed (68)
- type:enhancement (43)
- type:feature (23)
- type:task (20)
- type:question (14)
- type:maintenance (12)
- type:docs (10)
- feature_request (6)
- type:discussion (5)
- resolution:wontfix (4)
- deprecate (3)
- resolution:duplicate (2)
- dependencies (1)
- tag:help-wanted (1)
Top Pull Request Labels
- type:enhancement (34)
- reso:completed (20)
- type:bug (9)
- type:feature (9)
- type:docs (6)
- dependencies (6)
- type:maintenance (5)
- python:uv (4)
Package metadata
- Total packages: 2
-
Total downloads:
- pypi: 87,739 last-month
- Total docker downloads: 40
- Total dependent packages: 4 (may contain duplicates)
- Total dependent repositories: 8 (may contain duplicates)
- Total versions: 65
- Total maintainers: 4
pypi.org: pyswmm
Python Wrapper for SWMM5 API
- Homepage:
- Documentation: https://pyswmm.readthedocs.io/
- Licenses: BSD-2-Clause
- Latest release: 2.2.0 (published 2 months ago)
- Last Synced: 2026-11-30T00:55:56.573523Z (1 day ago)
- Versions: 32
- Dependent Packages: 4
- Dependent Repositories: 8
- Downloads: 87,739 Last month
- Docker Downloads: 40
-
Rankings:
- Dependent packages count: 1.865%
- Stargazers count: 4.05%
- Forks count: 4.241%
- Docker downloads count: 4.316%
- Average: 4.494%
- Dependent repos count: 5.165%
- Downloads: 7.326%
- Maintainers (4)
proxy.golang.org: github.com/pyswmm/pyswmm
- Homepage:
- Documentation: https://pkg.go.dev/github.com/pyswmm/pyswmm#section-documentation
- Licenses: other
- Latest release: v2.2.0+incompatible (published about 2 months ago)
- Last Synced: 2026-11-30T00:44:36.261761Z (1 day ago)
- Versions: 33
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
Dependencies
- ipython ==8.23.0
- pydata-sphinx-theme ==0.15.2
- sphinx ==7.2.6
- sphinx_copybutton ==0.5.2
- sphinx_design ==0.5.0
- actions/checkout v3 composite
- psf/black stable composite
- actions/checkout v5 composite
- actions/configure-pages v5 composite
- actions/deploy-pages v4 composite
- actions/setup-python v5 composite
- actions/upload-pages-artifact v3 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v2 composite
- accessible-pygments 0.0.5
- aenum 3.1.11
- alabaster 0.7.16
- asttokens 3.0.2
- babel 2.18.0
- beautifulsoup4 4.15.0
- black 25.11.0
- black 26.1.0
- certifi 2026.7.22
- cfgv 3.4.0
- cfgv 3.5.0
- charset-normalizer 3.5.2
- click 8.1.8
- click 8.3.1
- colorama 0.4.6
- decorator 5.3.1
- distlib 0.4.0
- docutils 0.20.1
- exceptiongroup 1.3.1
- executing 2.2.1
- filelock 3.19.1
- filelock 3.24.3
- identify 2.6.15
- identify 2.6.16
- idna 3.20
- imagesize 2.0.1
- iniconfig 2.1.0
- iniconfig 2.3.0
- ipython 8.23.0
- jedi 0.20.0
- jinja2 3.1.6
- julian 0.14
- markupsafe 3.0.3
- matplotlib-inline 0.2.2
- mypy-extensions 1.1.0
- nodeenv 1.10.0
- packaging 26.0
- parso 0.8.7
- pathspec 1.0.4
- pexpect 4.9.0
- platformdirs 4.4.0
- platformdirs 4.9.2
- pluggy 1.6.0
- pre-commit 4.3.0
- pre-commit 4.5.1
- prompt-toolkit 3.0.53
- ptyprocess 0.7.0
- pure-eval 0.2.4
- pydata-sphinx-theme 0.15.2
- pygments 2.19.2
- pyswmm 2.2.0
- pytest 8.4.2
- pytest 9.0.2
- python-discovery 1.1.0
- pytokens 0.4.1
- pyyaml 6.0.3
- requests 2.34.2
- snowballstemmer 3.1.1
- soupsieve 2.10
- sphinx 7.2.6
- sphinx-copybutton 0.5.2
- sphinx-design 0.5.0
- sphinxcontrib-applehelp 2.0.0
- sphinxcontrib-devhelp 2.0.0
- sphinxcontrib-htmlhelp 2.1.0
- sphinxcontrib-jsmath 1.0.1
- sphinxcontrib-qthelp 2.0.0
- sphinxcontrib-serializinghtml 2.0.0
- stack-data 0.6.3
- swmm-toolkit 0.9.1
- swmm-toolkit 0.10.0
- swmm-toolkit 0.11.0
- swmm-toolkit 0.12.0
- swmm-toolkit 0.13.0
- swmm-toolkit 0.14.0
- swmm-toolkit 0.17.0
- tomli 2.4.0
- traitlets 5.16.1
- typing-extensions 4.15.0
- urllib3 2.8.0
- virtualenv 21.0.0
- wcwidth 0.9.1
- julian >=0.14
- packaging >=26.0
- swmm-toolkit <1.0.0
Score: 20.59311159247503
