Package: pyswmm
python wrappers for the Stormwater Management Model (SWMM5)Getting startedProject Website:www.pyswmm.orgOfficial PySWMM DocumentationPySWMM YouTube ChannelPySWMM Example BundlesIntroducing the SWAG STORE! All Proceeds go toward the hosting/service fees related to maintaining the PySWMM Project!!!  Get yourself a hoodie or coffee cup!PySWMM SWAG Store🆘Do you need HELP?🆘GitHub Discussionsto answer support questions related to PySWMM.Cite our PaperMcDonnell, 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.02292YouTube Training VidoesSetting a manhole inflow during a running simulation!OverviewPySWMM 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.GoalsPySWMM is intended to providetools 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.InstallGet the latest version of PySWMM fromPyPISee theQuick
Guide!$ pip install pyswmmAs 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]SWMM and Python Compatibility Tablepyswmm versionswmm-toolkit compatibility(SWMM engine)python compatibility1.0.0 - 1.1.10.8.2 (SWMM 5.1.13)3.6 - 3.91.2.0 - 1.5.00.9.1 - 0.15.0 (SWMM 5.1.14 - 5.2.4)Note: 0.11.0 (SWMM 5.2.0) only supported on windows3.7 - 3.12UsageA quick example that steps through a simulation:Examples:See theLatte ExamplefrompyswmmimportSimulation,Nodes,LinkswithSimulation(r'Example1.inp')assim: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!forind,stepinenumerate(sim):ifind%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.frompyswmmimportOutput,SubcatchSeries,NodeSeries,LinkSeries,SystemSerieswithOutput('model.out')asout:print(len(out.subcatchments))print(len(out.nodes))print(len(out.links))print(out.version)sub_ts=SubcatchSeries(out)['S1'].runoff_ratenode_ts=NodeSeries(out)['J1'].invert_depthlink_ts=LinkSeries(out)['C2'].flow_ratesys_ts=SystemSeries(out).rainfallBugsOur issue tracker is athttps://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).ContributingPlease check out our Wikihttps://github.com/pyswmm/pyswmm/wikifor more information
on contributing, including an Author Contribution Checklist.LicenseDistributed with a BSD2 license; see LICENSE.txt:Copyright (C) 2014-2024 PySWMM Developers
Community-Owned See AUTHORS and CITATION.cff