Skip to content

SWMMEnablement/SwmmIcmConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWMM to ICM Converter

A Streamlit-based engineering utility for converting EPA SWMM binary output files (.out) into ICM InfoWorks-compatible CSV files for flow survey import, result review, and observed-versus-predicted analysis.

Repository: SWMMEnablement/SwmmIcmConverter
Replit app: replit.com/@robertdickinson/SwmmIcmConverter


Overview

SWMM to ICM Converter is a web-based tool built with Streamlit that reads SWMM binary output files (.out) and exports time-series data in ICM InfoWorks CSV format. The application is designed for hydraulic modelers who want to move simulated SWMM results into ICM-compatible observed-data style imports for review, comparison, and analysis. [page:46]

The app automatically detects the available nodes and links in an uploaded SWMM output file, lets users choose variables and elements to extract, and formats the result into a CSV structure suitable for InfoWorks ICM flow survey import. It also supports optional time filtering, resampling, and unit conversion before export. [page:46]


Main features

Automatic element discovery

After a SWMM .out file is uploaded, the application automatically extracts available nodes and links using swmmtoolbox.listdetail(). This removes the need for the user to manually inspect the output file before choosing what to export. [page:46]

Three conversion modes

The tool supports three extraction modes:

  • Single Element — extract one variable from one element. [page:46]
  • Batch Conversion — extract the same variable from multiple elements into a single CSV. [page:46]
  • Multiple Variables — extract multiple variables from one element into multiple columns. [page:46]

This flexibility makes the app suitable for both quick one-off exports and larger review workflows. [page:46]

Time filtering

Users can apply an optional start/end time filter to extract data only for a specific period. This is useful for isolating storm events, calibration windows, or survey periods of interest. [page:46]

Data resampling

The exported time series can be resampled to intervals ranging from 5 minutes to 1 day, with selectable aggregation methods including mean, max, min, and sum. This is useful when the target ICM workflow or downstream comparison requires a different temporal resolution than the native SWMM reporting interval. [page:46]

Unit conversion

The app includes built-in conversions for:

  • CFS ↔ CMS
  • Feet ↔ Meters [page:46]

This helps users align SWMM output units with project conventions or ICM import expectations. [page:46]


Supported data

Input

  • SWMM binary output files (.out) [page:46]

Output

  • ICM InfoWorks CSV format containing:
    • global metadata section,
    • local metadata section,
    • and time-series rows with DateTime and value columns. [page:46]

Supported variables

Link variables

  • Flow Rate
  • Depth
  • Velocity
  • Volume
  • Capacity [page:46]

Node variables

  • Total Inflow
  • Total Outflow
  • Flooding Loss
  • Depth
  • Head [page:46]

This variable set makes the tool useful for importing many of the most common hydraulic result series from SWMM into an ICM-oriented review process. [page:46]


Why this tool is useful

SWMM .out files are binary and not especially convenient for direct use in spreadsheet workflows or ICM-style survey imports. This app bridges that gap by turning model output into a structured CSV format aligned with InfoWorks ICM flow-survey import conventions. [page:46]

That makes the tool helpful for:

  • comparing simulated SWMM results against observed data in ICM workflows,
  • extracting key node or link time series for QA/QC,
  • producing event-specific exports,
  • standardizing result formatting across tools,
  • and reducing manual post-processing. [page:46]

Tech stack

The repository is 100% Python according to GitHub’s language breakdown, and the handover describes the app as a stateless Streamlit tool with no database or authentication. [page:46]

Core libraries

  • Streamlit — frontend/UI framework. [page:46]
  • swmmtoolbox — SWMM binary output extraction. [page:46]
  • pandas — time-series manipulation and resampling. [page:46]
  • datetime — timestamp handling and conversion. [page:46]

Runtime characteristics

  • Stateless file-conversion workflow. [page:46]
  • No persistent storage. [page:46]
  • No authentication or session management. [page:46]
  • Independent, temporary conversions only. [page:46]

System architecture

Frontend architecture

The application uses Streamlit with a wide layout to provide a data-focused interface. The UI includes a file uploader, dynamic selectors for element types and variables, radio-button mode selection, multiselect support for batch conversion, and form controls that update based on user choices. [page:46]

Data-processing pipeline

The app reads uploaded files through Streamlit, writes them temporarily using Python’s tempfile support, extracts data with swmmtoolbox, and then uses pandas DataFrames to transform the result into ICM-friendly CSV output. This separation of upload handling, extraction, transformation, and formatting keeps the tool maintainable. [page:46]

Time-series handling

The tool converts SWMM timestep indices into absolute datetime values using a configurable start time. The handover notes that a datetime bug was fixed by switching from timedelta(hours=...) to timedelta(minutes=...), which corrected timestep interpretation. [page:46]

File handling

Because Streamlit uploads files as byte streams, the app uses temporary files so swmmtoolbox can process the uploaded .out files correctly. The temp files are then cleaned up after processing to avoid storage buildup. [page:46]


Repository structure

SwmmIcmConverter/
├── .streamlit/         # Streamlit configuration
├── attached_assets/    # Supporting files/assets
├── .replit             # Replit runtime config
├── app.py              # Main Streamlit app
├── main.py             # Alternate/startup entry point
├── pyproject.toml      # Python project configuration
├── replit.md           # Project overview and architecture notes
└── uv.lock             # Dependency lockfile

The commit history shown on GitHub includes enhancements such as preset templates for common conversion scenarios, quick setup templates, and libraries added to support file-conversion functionality. [page:46]


Typical workflow

  1. Upload a SWMM .out file. [page:46]
  2. Let the app automatically discover available nodes and links. [page:46]
  3. Choose one of the three extraction modes. [page:46]
  4. Select the desired element(s) and variable(s). [page:46]
  5. Optionally apply time filtering, resampling, and unit conversion. [page:46]
  6. Export the resulting CSV in ICM InfoWorks-compatible format. [page:46]

This workflow is especially useful when a modeler needs quick access to time-series outputs without manually scripting SWMM post-processing. [page:46]


Running locally

Prerequisites

  • Python 3.x
  • A package manager compatible with pyproject.toml / uv.lock
  • Access to the required Python libraries, especially streamlit, swmmtoolbox, and pandas [page:46]

Install dependencies

Depending on your setup, install from the project configuration:

pip install -r requirements.txt

or use the environment manager associated with pyproject.toml and uv.lock.

Start the application

streamlit run app.py

If main.py is the intended launcher in your environment, that can be used instead, but the repository structure suggests app.py is the primary Streamlit entry point. [page:46]


Recent improvements

The replit.md notes a set of changes dated November 9, 2025, including: [page:46]

  • automatic element discovery,
  • the three conversion modes,
  • optional time filtering,
  • data resampling,
  • unit conversion,
  • enhanced UI controls,
  • and a fix to datetime handling. [page:46]

These updates indicate the tool has moved beyond a minimal converter and into a more flexible engineering export utility. [page:46]


Intended audience

This repository is primarily for:

  • SWMM modelers,
  • InfoWorks ICM users,
  • hydraulic engineers,
  • flow-survey analysts,
  • and consultants who need to move simulated SWMM results into ICM-friendly CSV structures. [page:46]

Because it is lightweight and stateless, it is also well suited for quick internal engineering workflows or deployment as a small utility app. [page:46]


Documentation

The best current internal documentation is replit.md, which describes the system architecture, supported conversions, data pipeline, dependencies, and the stateless operating model. The repository currently shows GitHub’s Add a README prompt, so adding this file would make the tool much clearer to visitors. [page:46]


License

Add the appropriate license here if the repository is intended for public reuse.

Releases

No releases published

Packages

 
 
 

Contributors

Languages