{"id":12122,"date":"2025-04-22T07:08:06","date_gmt":"2025-04-22T07:08:06","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=12122"},"modified":"2026-02-21T07:13:16","modified_gmt":"2026-02-21T07:13:16","slug":"swmm-api-python-powered-real-time-access-to-epas-swmm-models","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/","title":{"rendered":"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"507\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7-1024x507.png\" alt=\"\" class=\"wp-image-12123\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7-1024x507.png 1024w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7-300x148.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7-768x380.png 768w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7.png 1437w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>#WhatIsSwmmAPI<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. What is swmm-api?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>swmm-api<\/code><\/strong> is an open-source Python library that provides a <strong>low-level, real-time interface<\/strong> to the <strong>EPA Storm Water Management Model (SWMM)<\/strong>. It allows Python developers to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Read, modify, and control SWMM simulations<\/strong> dynamically<\/li>\n\n\n\n<li>Access <strong>internal states<\/strong> of SWMM objects at each timestep<\/li>\n\n\n\n<li>Inject <strong>custom control logic<\/strong> for pumps, valves, inflows, or rain events<\/li>\n\n\n\n<li><strong>Integrate SWMM<\/strong> models into automated workflows, simulations, or optimization loops<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Unlike high-level tools like <code>PySWMM<\/code>, <code>swmm-api<\/code> provides <strong>direct memory access<\/strong> to the internal SWMM simulation, making it extremely powerful for <strong>real-time control<\/strong>, <strong>data assimilation<\/strong>, and <strong>fine-grained simulation manipulation<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is developed and maintained by <a href=\"https:\/\/github.com\/jbgo\/swmm-api\">jbgo\/swmm-api<\/a> and supports SWMM5 engine integration across platforms.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading\"><strong>#SwmmAPIUseCases<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Major Use Cases of swmm-api<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>swmm-api<\/code> package offers advanced control and automation for stormwater simulations. It is best suited for professionals and developers requiring <strong>programmatic, stepwise control<\/strong> of the simulation process.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udca7 <strong>2.1. Real-Time Control (RTC) of Urban Drainage Systems<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Implement <strong>sensor-driven<\/strong> control of gates, pumps, or regulators<\/li>\n\n\n\n<li>Integrate SCADA systems to drive SWMM control logic<\/li>\n\n\n\n<li>Update model parameters based on live weather or flow data<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddea <strong>2.2. Calibration and Sensitivity Analysis<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adjust parameters (e.g., catchment area, slope, or roughness) during runtime<\/li>\n\n\n\n<li>Run multiple simulation iterations programmatically<\/li>\n\n\n\n<li>Export results for analysis or optimization<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcca <strong>2.3. Research and Custom Simulation Scenarios<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Experiment with novel flow control strategies<\/li>\n\n\n\n<li>Apply <strong>machine learning<\/strong> to predict optimal setpoints<\/li>\n\n\n\n<li>Conduct storm event scenario testing with variable rainfall profiles<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udce1 <strong>2.4. Data Assimilation and Digital Twins<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ingest real-time sensor data (rainfall, depth, flow) and simulate system response<\/li>\n\n\n\n<li>Use SWMM as a <strong>digital twin<\/strong> of a physical urban stormwater system<\/li>\n\n\n\n<li>Validate and refine predictive models in real-time<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddf0 <strong>2.5. Automation and Workflow Integration<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Integrate with <strong>CI\/CD pipelines<\/strong>, <strong>APIs<\/strong>, or <strong>data dashboards<\/strong><\/li>\n\n\n\n<li>Use in notebooks or remote simulations<\/li>\n\n\n\n<li>Combine with optimization libraries like <code>scipy.optimize<\/code> or <code>pyomo<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading\"><strong>#SwmmAPIArchitecture<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. How swmm-api Works \u2013 Architecture Overview<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>swmm-api<\/code> package operates by directly interfacing with the <strong>SWMM5 engine\u2019s compiled binary<\/strong> (usually <code>swmm5.dll<\/code> or <code>swmm5.so<\/code>) and accessing its <strong>simulation memory<\/strong> using Python\u2019s <code>ctypes<\/code> module.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddf1 <strong>3.1. Architecture Layers<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u2705 <strong>A. SWMM Engine (Core)<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Original C-based SWMM5 engine (e.g., version 5.1.15 or newer)<\/li>\n\n\n\n<li>Responsible for time-based hydrologic\/hydraulic simulations<\/li>\n\n\n\n<li>Processes <code>.inp<\/code> files defining system topology and parameters<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u2705 <strong>B. swmm-api Memory Interface<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Loads SWMM engine dynamically using ctypes<\/li>\n\n\n\n<li>Attaches to the <strong>in-memory objects<\/strong> used during simulation<\/li>\n\n\n\n<li>Provides access to core SWMM structures like:\n<ul class=\"wp-block-list\">\n<li>Nodes<\/li>\n\n\n\n<li>Links<\/li>\n\n\n\n<li>Subcatchments<\/li>\n\n\n\n<li>Controls<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u2705 <strong>C. Python Interface Layer<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Offers Pythonic classes and methods to:\n<ul class=\"wp-block-list\">\n<li>Read simulation outputs in real time<\/li>\n\n\n\n<li>Set inflows, control settings, and time parameters<\/li>\n\n\n\n<li>Monitor water quality, depth, volume, and more<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u2705 <strong>D. User Script \/ Application<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Typically written in Python<\/li>\n\n\n\n<li>Drives the simulation loop, custom control logic, optimization, or logging<\/li>\n\n\n\n<li>Optionally visualizes results using <code>matplotlib<\/code>, <code>pandas<\/code>, or <code>Plotly<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading\"><strong>#SwmmAPIWorkflow<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Basic Workflow of swmm-api<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s a high-level view of how a typical <code>swmm-api<\/code> based simulation workflow proceeds:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd04 <strong>Simulation Loop Workflow<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Step<\/th><th>Action<\/th><\/tr><\/thead><tbody><tr><td>1.<\/td><td>Load and compile the SWMM5 engine (DLL or shared object)<\/td><\/tr><tr><td>2.<\/td><td>Initialize simulation with <code>.inp<\/code> model<\/td><\/tr><tr><td>3.<\/td><td>Step through the simulation in real-time (1 timestep at a time)<\/td><\/tr><tr><td>4.<\/td><td>At each step, read\/write values (e.g., depth, flow, rainfall)<\/td><\/tr><tr><td>5.<\/td><td>Optionally modify parameters based on logic or inputs<\/td><\/tr><tr><td>6.<\/td><td>Save results or visualize after simulation completes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd0d <strong>Access Points<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>getNodeParam<\/code>, <code>setLinkFlow<\/code>, <code>getRainfall<\/code><\/li>\n\n\n\n<li><code>stepSimulation<\/code>, <code>getSimulationTime<\/code>, <code>getWaterQuality<\/code><\/li>\n\n\n\n<li>All access is low-level and performant (direct pointer access)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading\"><strong>#GettingStartedWithSwmmAPI<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Step-by-Step Guide to Using swmm-api<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This guide assumes you&#8217;re familiar with SWMM <code>.inp<\/code> files and basic Python.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Step 1: Install Dependencies<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Clone the repository:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit clone https:\/\/github.com\/jbgo\/swmm-api.git\ncd swmm-api\npip install -r requirements.txt\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Install a compatible version of <strong>SWMM5 engine<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Windows: download <code>swmm5.dll<\/code><\/li>\n\n\n\n<li>Linux: compile <code>swmm5.so<\/code><\/li>\n\n\n\n<li>Place it in your project directory or system path<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Step 2: Prepare a SWMM Model<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use EPA SWMM or QGIS plugin to create a <code>.inp<\/code> file defining:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Subcatchments<\/li>\n\n\n\n<li>Junctions<\/li>\n\n\n\n<li>Pipes<\/li>\n\n\n\n<li>Control rules<\/li>\n\n\n\n<li>Simulation time and rainfall data<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Step 3: Initialize Simulation<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom swmm_api.input_file import read_inp_file\nfrom swmm_api.simulation import Simulation\n\ninp = read_inp_file(&quot;model.inp&quot;)\nsim = Simulation(inp)\n\nsim.start()\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Step 4: Step Through Simulation<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwhile not sim.is_finished():\n    sim.step_advance()  # advance simulation\n    flow = sim.get_link_result(&#039;C1&#039;)&#x5B;&#039;flow_rate&#039;]\n    depth = sim.get_node_result(&#039;J2&#039;)&#x5B;&#039;depth&#039;]\n    print(f&quot;Flow at C1: {flow:.2f} m\u00b3\/s, Depth at J2: {depth:.3f} m&quot;)\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Step 5: Inject Custom Logic<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nif depth &amp;gt; 1.5:\n    sim.set_link_setting(&#039;C1&#039;, 0.3)  # throttle valve\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Step 6: Post-Process and Visualize<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\n\ntimes = sim.get_times()\nflows = sim.get_link_result(&#039;C1&#039;)&#x5B;&#039;flow_rate_series&#039;]\n\nplt.plot(times, flows)\nplt.title(&quot;Flow Rate at Conduit C1&quot;)\nplt.xlabel(&quot;Time&quot;)\nplt.ylabel(&quot;Flow (m\u00b3\/s)&quot;)\nplt.show()\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Step 7: Advanced Uses<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Combine with sensor data via <code>requests<\/code> or MQTT<\/li>\n\n\n\n<li>Integrate with Jupyter notebooks for interactive analysis<\/li>\n\n\n\n<li>Automate batch runs for calibration<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>#WhatIsSwmmAPI 1. What is swmm-api? swmm-api is an open-source Python library that provides a low-level, real-time interface to the EPA [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[1],"tags":[7328,7326,7323,7325,7319,7327,7322,7314,7321,7329,7324],"class_list":["post-12122","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-digitaltwins","tag-epawatertools","tag-hydrology","tag-pythonsimulation","tag-realtimecontrol","tag-smartcities","tag-stormwatermodeling","tag-swmm5","tag-swmmapi","tag-swmmrtc","tag-urbandrainage"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"#WhatIsSwmmAPI 1. What is swmm-api? swmm-api is an open-source Python library that provides a low-level, real-time interface to the EPA [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-22T07:08:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-21T07:13:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1437\" \/>\n\t<meta property=\"og:image:height\" content=\"711\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vijay K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vijay K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/\"},\"author\":{\"name\":\"Vijay K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/cfa38eecbe3e269e8f07ec45eb57ad5c\"},\"headline\":\"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models\",\"datePublished\":\"2025-04-22T07:08:06+00:00\",\"dateModified\":\"2026-02-21T07:13:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/\"},\"wordCount\":624,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image-7-1024x507.png\",\"keywords\":[\"DigitalTwins\",\"EPAWaterTools\",\"Hydrology\",\"PythonSimulation\",\"RealTimeControl\",\"SmartCities\",\"StormwaterModeling\",\"SWMM5\",\"swmmAPI\",\"SWMMRTC\",\"UrbanDrainage\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/\",\"name\":\"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image-7-1024x507.png\",\"datePublished\":\"2025-04-22T07:08:06+00:00\",\"dateModified\":\"2026-02-21T07:13:16+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/cfa38eecbe3e269e8f07ec45eb57ad5c\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image-7.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image-7.png\",\"width\":1437,\"height\":711},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/cfa38eecbe3e269e8f07ec45eb57ad5c\",\"name\":\"Vijay K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ecf5c2016b85601f9f2f6112e9bbfe5969cbd08edd7ad8775b4db108b9418f0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ecf5c2016b85601f9f2f6112e9bbfe5969cbd08edd7ad8775b4db108b9418f0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ecf5c2016b85601f9f2f6112e9bbfe5969cbd08edd7ad8775b4db108b9418f0?s=96&d=mm&r=g\",\"caption\":\"Vijay K\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/vijay\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/","og_locale":"en_US","og_type":"article","og_title":"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models - scmGalaxy","og_description":"#WhatIsSwmmAPI 1. What is swmm-api? swmm-api is an open-source Python library that provides a low-level, real-time interface to the EPA [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/","og_site_name":"scmGalaxy","article_published_time":"2025-04-22T07:08:06+00:00","article_modified_time":"2026-02-21T07:13:16+00:00","og_image":[{"width":1437,"height":711,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7.png","type":"image\/png"}],"author":"Vijay K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vijay K","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/"},"author":{"name":"Vijay K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/cfa38eecbe3e269e8f07ec45eb57ad5c"},"headline":"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models","datePublished":"2025-04-22T07:08:06+00:00","dateModified":"2026-02-21T07:13:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/"},"wordCount":624,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7-1024x507.png","keywords":["DigitalTwins","EPAWaterTools","Hydrology","PythonSimulation","RealTimeControl","SmartCities","StormwaterModeling","SWMM5","swmmAPI","SWMMRTC","UrbanDrainage"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/","name":"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7-1024x507.png","datePublished":"2025-04-22T07:08:06+00:00","dateModified":"2026-02-21T07:13:16+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/cfa38eecbe3e269e8f07ec45eb57ad5c"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2025\/04\/image-7.png","width":1437,"height":711},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/swmm-api-python-powered-real-time-access-to-epas-swmm-models\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Swmm-Api: Python-Powered Real-Time Access to EPA\u2019s SWMM Models"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/cfa38eecbe3e269e8f07ec45eb57ad5c","name":"Vijay K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2ecf5c2016b85601f9f2f6112e9bbfe5969cbd08edd7ad8775b4db108b9418f0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2ecf5c2016b85601f9f2f6112e9bbfe5969cbd08edd7ad8775b4db108b9418f0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ecf5c2016b85601f9f2f6112e9bbfe5969cbd08edd7ad8775b4db108b9418f0?s=96&d=mm&r=g","caption":"Vijay K"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/vijay\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/12122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=12122"}],"version-history":[{"count":3,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/12122\/revisions"}],"predecessor-version":[{"id":20355,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/12122\/revisions\/20355"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=12122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=12122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=12122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}