<div align="center" style="max-width:500px;margin: auto;">
<img src="https://raw.githubusercontent.com/pyswmm/pyswmm/master/docs/source/_static/type-logo-black.png"><br>
</div>
# python wrappers for the Stormwater Management Model (SWMM5)
[![GitHub Actions Build Status](https://github.com/pyswmm/pyswmm/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/pyswmm/pyswmm/actions/workflows/python-package.yml)
[![Documentation Status](https://github.com/pyswmm/pyswmm/actions/workflows/documentation.yml/badge.svg?branch=master)](http://docs.pyswmm.org/)
[![License](https://img.shields.io/pypi/l/pyswmm.svg)](LICENSE.txt)
[![Latest PyPI version](https://img.shields.io/pypi/v/pyswmm.svg)](https://pypi.python.org/pypi/pyswmm/)
[![PyPI Monthly Downloads](https://img.shields.io/badge/dynamic/json.svg?label=Downloads&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Fpyswmm%2Frecent&query=%24.data.last_month&colorB=green&suffix=%20last%20month)](https://pypi.python.org/pypi/pyswmm/)
[![Cite our Paper](https://joss.theoj.org/papers/10.21105/joss.02292/status.svg)](https://doi.org/10.21105/joss.02292)
## Getting started
* Project Website: [www.pyswmm.org](https://www.pyswmm.org)
* [Official PySWMM Documentation](http://docs.pyswmm.org)
* [PySWMM YouTube Channel](https://www.youtube.com/channel/UCv-OYsz2moiMRzZIRhqbpHA/featured)
* [PySWMM Example Bundles](https://www.pyswmm.org/examples)
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!
* [PySWMM SWAG Store](https://www.zazzle.com/store/pyswmm)
🆘Do you need HELP?🆘
> [GitHub Discussions](https://github.com/pyswmm/pyswmm/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 Vidoes
Setting a manhole inflow during a running simulation!
> [![image](http://img.youtube.com/vi/i4AOHwKyvNw/0.jpg)](https://www.youtube.com/watch?v=i4AOHwKyvNw)
# 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](https://pypi.python.org/pypi/pyswmm/) See the [Quick
Guide](https://www.pyswmm.org/docs)!
```
$ 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]
```
### SWMM and Python Compatibility Table
| pyswmm version | swmm-toolkit compatibility<br>(SWMM engine) | python compatibility |
| -------------- | ------------------------------------------------------------ | -------------------- |
| 1.0.0 - 1.1.1 | 0.8.2 (SWMM 5.1.13) | 3.6 - 3.9 |
| 1.2.0 - 1.5.0 | 0.9.1 - 0.15.0 (SWMM 5.1.14 - 5.2.4)<br>Note: 0.11.0 (SWMM 5.2.0) only supported on windows | 3.7 - 3.12 |
# Usage
A quick example that steps through a simulation:
Examples:
See the [Latte Example](https://www.pyswmm.org/examples)
``` python
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.
``` python
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
```
# 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).
# Contributing
Please check out our Wiki
<https://github.com/pyswmm/pyswmm/wiki> for more information
on contributing, including an Author Contribution Checklist.
# License
Distributed with a BSD2 license; see LICENSE.txt:
Copyright (C) 2014-2024 PySWMM Developers
Community-Owned See AUTHORS and CITATION.cff
Raw data
{
"_id": null,
"home_page": "https://www.pyswmm.org",
"name": "pyswmm",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "swmm5, swmm, hydraulics, hydrology, modeling, collection system",
"author": "Bryant E. McDonnell (See AUTHORS)",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/a9/69/682dfcc7e594d0f45c07d769264fb74351c72628ea48d24465efb19b900a/pyswmm-2.0.1.tar.gz",
"platform": null,
"description": "<div align=\"center\" style=\"max-width:500px;margin: auto;\">\n <img src=\"https://raw.githubusercontent.com/pyswmm/pyswmm/master/docs/source/_static/type-logo-black.png\"><br>\n</div>\n\n\n# python wrappers for the Stormwater Management Model (SWMM5)\n\n[![GitHub Actions Build Status](https://github.com/pyswmm/pyswmm/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/pyswmm/pyswmm/actions/workflows/python-package.yml)\n[![Documentation Status](https://github.com/pyswmm/pyswmm/actions/workflows/documentation.yml/badge.svg?branch=master)](http://docs.pyswmm.org/)\n[![License](https://img.shields.io/pypi/l/pyswmm.svg)](LICENSE.txt)\n[![Latest PyPI version](https://img.shields.io/pypi/v/pyswmm.svg)](https://pypi.python.org/pypi/pyswmm/)\n[![PyPI Monthly Downloads](https://img.shields.io/badge/dynamic/json.svg?label=Downloads&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Fpyswmm%2Frecent&query=%24.data.last_month&colorB=green&suffix=%20last%20month)](https://pypi.python.org/pypi/pyswmm/)\n[![Cite our Paper](https://joss.theoj.org/papers/10.21105/joss.02292/status.svg)](https://doi.org/10.21105/joss.02292)\n\n## Getting started\n\n* Project Website: [www.pyswmm.org](https://www.pyswmm.org)\n\n* [Official PySWMM Documentation](http://docs.pyswmm.org)\n\n* [PySWMM YouTube Channel](https://www.youtube.com/channel/UCv-OYsz2moiMRzZIRhqbpHA/featured)\n\n\n* [PySWMM Example Bundles](https://www.pyswmm.org/examples)\n\nIntroducing the SWAG STORE! All Proceeds go toward the hosting/service fees related to maintaining the PySWMM Project!!! Get yourself a hoodie or coffee cup!\n\n\n* [PySWMM SWAG Store](https://www.zazzle.com/store/pyswmm)\n\n\ud83c\udd98Do you need HELP?\ud83c\udd98\n> [GitHub Discussions](https://github.com/pyswmm/pyswmm/discussions)\n> to answer support questions related to PySWMM.\n\nCite our Paper \n> McDonnell, Bryant E., Ratliff, Katherine M., Tryby, Michael E., Wu,\n> Jennifer Jia Xin, & Mullapudi, Abhiram. (2020). PySWMM: The Python\n> Interface to Stormwater Management Model (SWMM). *Journal of Open\n> Source Software, 5*(52), 2292, <https://doi.org/10.21105/joss.02292>\n\n# YouTube Training Vidoes\n\nSetting a manhole inflow during a running simulation! \n> [![image](http://img.youtube.com/vi/i4AOHwKyvNw/0.jpg)](https://www.youtube.com/watch?v=i4AOHwKyvNw)\n\n# Overview\n\nPySWMM is a Python language software package for the creation,\nmanipulation, and study of the structure, dynamics, and function of\ncomplex networks.\n\nWith PySWMM you can load and manipulate USEPA Stormwater Management\nModels. With the development of PySWMM, control algorithms can now be\ndeveloped exclusively in Python which allows the use of functions and\nobjects as well as storing and tracking hydraulic trends for control\nactions.\n\nAs of version v1.1.0, PySWMM includes new features to process metadata\nand timeseries stored in SWMM binary output file.\n\n# Who uses PySWMM?\n\nPySWMM is used by engineers, modelers, and researchers who want to\nstreamline stormwater modeling optimization, controls, and\npost-processing results.\n\n# Goals\n\nPySWMM is intended to provide\n\n- tools for the study of the structure and dynamics within USEPA\n SWMM5,\n- a standard programming interface and graph implementation that is\n suitable for many applications,\n- a rapid development environment for collaborative, multidisciplinary\n projects,\n- an interface to USEPA SWMM5,\n- development and implementation of control logic outside of native\n EPA-SWMM Controls,\n- methods for users to establish their own node inflows,\n- a coding interface to binary output files,\n- new modeling possibilities for the SWMM5 Community.\n\n# Install\n\nGet the latest version of PySWMM from\n[PyPI](https://pypi.python.org/pypi/pyswmm/) See the [Quick\nGuide](https://www.pyswmm.org/docs)!\n\n```\n$ pip install pyswmm\n```\nAs 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:\n\n```\n$ pip install pyswmm[swmm5.2.4]\n```\n\n### SWMM and Python Compatibility Table\n\n| pyswmm version | swmm-toolkit compatibility<br>(SWMM engine) | python compatibility |\n| -------------- | ------------------------------------------------------------ | -------------------- |\n| 1.0.0 - 1.1.1 | 0.8.2 (SWMM 5.1.13) | 3.6 - 3.9 |\n| 1.2.0 - 1.5.0 | 0.9.1 - 0.15.0 (SWMM 5.1.14 - 5.2.4)<br>Note: 0.11.0 (SWMM 5.2.0) only supported on windows | 3.7 - 3.12 |\n\n# Usage\n\nA quick example that steps through a simulation:\n\nExamples:\n\nSee the [Latte Example](https://www.pyswmm.org/examples)\n\n``` python\nfrom pyswmm import Simulation, Nodes, Links\n\nwith Simulation(r'Example1.inp') as sim:\n Node21 = Nodes(sim)[\"21\"]\n print(\"Invert Elevation: {}\". format(Node21.invert_elevation))\n\n Link15 = Links(sim)['15']\n print(\"Outlet Node ID: {}\".format(Link15.outlet_node))\n\n # Launch a simulation!\n for ind, step in enumerate(sim):\n if ind % 100 == 0:\n print(sim.current_time,\",\",round(sim.percent_complete*100),\"%\",\\\n Node21.depth, Link15.flow)\n```\n\nOpening a SWMM binary output file and accessing model metadata and\ntimeseries.\n\n``` python\nfrom pyswmm import Output, SubcatchSeries, NodeSeries, LinkSeries, SystemSeries\n\nwith Output('model.out') as out:\n print(len(out.subcatchments))\n print(len(out.nodes))\n print(len(out.links))\n print(out.version)\n\n sub_ts = SubcatchSeries(out)['S1'].runoff_rate\n node_ts = NodeSeries(out)['J1'].invert_depth\n link_ts = LinkSeries(out)['C2'].flow_rate\n sys_ts = SystemSeries(out).rainfall\n```\n\n# Bugs\n\nOur issue tracker is at\n<https://github.com/pyswmm/pyswmm/issues>. Please report any\nbugs that you find. Or, even better, fork the repository on GitHub and\ncreate a pull request. All changes are welcome, big or small, and we\nwill help you make the pull request if you are new to git (just ask on\nthe issue).\n\n# Contributing\n\nPlease check out our Wiki\n<https://github.com/pyswmm/pyswmm/wiki> for more information\non contributing, including an Author Contribution Checklist.\n\n# License\n\nDistributed with a BSD2 license; see LICENSE.txt:\n\n Copyright (C) 2014-2024 PySWMM Developers\n Community-Owned See AUTHORS and CITATION.cff\n\n",
"bugtrack_url": null,
"license": "BSD2 License",
"summary": "Python Wrapper for SWMM5 API",
"version": "2.0.1",
"project_urls": {
"Homepage": "https://www.pyswmm.org"
},
"split_keywords": [
"swmm5",
" swmm",
" hydraulics",
" hydrology",
" modeling",
" collection system"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "86aa044e0c2891870c7d7e802a19c5a8e511ea944983aed97c0fa32946564ec5",
"md5": "44b043da625285dcb3690f00d1e59c27",
"sha256": "22d50936039b822904500c642ddd69102d5cbd5c1f29523214cbc5d0e7ad55c1"
},
"downloads": -1,
"filename": "pyswmm-2.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "44b043da625285dcb3690f00d1e59c27",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 111829,
"upload_time": "2024-05-06T03:45:15",
"upload_time_iso_8601": "2024-05-06T03:45:15.885570Z",
"url": "https://files.pythonhosted.org/packages/86/aa/044e0c2891870c7d7e802a19c5a8e511ea944983aed97c0fa32946564ec5/pyswmm-2.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a969682dfcc7e594d0f45c07d769264fb74351c72628ea48d24465efb19b900a",
"md5": "768bbb3a72b20c2a17cb69d7aec3b9fc",
"sha256": "b85eb4ac459d67f1a268af8242f9f38ac85dd6e20d6171de008acb7b6b88af0f"
},
"downloads": -1,
"filename": "pyswmm-2.0.1.tar.gz",
"has_sig": false,
"md5_digest": "768bbb3a72b20c2a17cb69d7aec3b9fc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 85900,
"upload_time": "2024-05-06T03:45:18",
"upload_time_iso_8601": "2024-05-06T03:45:18.061693Z",
"url": "https://files.pythonhosted.org/packages/a9/69/682dfcc7e594d0f45c07d769264fb74351c72628ea48d24465efb19b900a/pyswmm-2.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-06 03:45:18",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyswmm"
}