Production Python for turning high-frequency SCADA telemetry into defensible Safe Drinking Water Act (SDWA) compliance.
WaterUtility.org is a free, in-depth engineering reference for the teams that keep drinking water safe and provably compliant. It takes the messy reality of water-utility automation β irregular sensor feeds, shifting federal and state rules, unforgiving reporting deadlines β and turns it into concrete, copy-ready Python you can actually ship.
Every guide is grounded in the real regulatory text (40 CFR Part 141, EPA analytical methods, state primacy rules) and pairs it with runnable code, hand-drawn architecture diagrams, and the failure modes nobody warns you about until an audit.
- Water-utility operations & SCADA engineers wiring historians, PLCs, and analyzers into a compliance pipeline.
- Environmental compliance teams who sign the Discharge Monitoring Reports, Consumer Confidence Reports, and public notices.
- Municipal developers & Python automation builders turning telemetry into deterministic, audit-ready rule logic.
The library is organised into three connected areas, each with focused topics and step-by-step implementation guides:
The regulatory backbone: mapping EPA Maximum Contaminant Levels to relational schemas, monitoring-frequency scheduling, violation-code classification, OT/IT security boundaries, DMR generation & SDWIS submission, and tamper-evident audit-trail storage (append-only Parquet, append-only PostgreSQL, cryptographic hash chains).
Getting trustworthy numbers off the wire: Modbus TCP register parsing, OPC UA node extraction and alarms, aligning irregular timestamps to UTC, resampling to regulatory windows, asynchronous batch processing with Celery, and integrating process historians (OSIsoft/AVEVA PI, InfluxDB).
The part that decides what counts as a violation: real-time MCL exceedance detection, locational running annual averages, monitoring-gap detection, severity scoring, operational warning bands and deadband tuning, and automated public-notification workflows (Tier 1/2/3 triggers, multi-channel dispatch, state-primacy deadlines).
- Runnable, production-grade Python β not pseudocode. Pinned libraries, real error handling, deterministic results.
- Regulation-first β every technique is tied to the rule that requires it, so the code and the compliance story stay in sync.
- Original diagrams β hand-authored, accessible, theme-aware SVGs that explain the hardest concept on each page.
- Audit-ready by design β immutability, data lineage, and reproducible determinations are treated as first-class requirements.
- Fast and accessible β a static site that meets WCAG 2 AA, ships tiny pages, and works great on mobile.
- Eleventy static-site generator (Nunjucks + Markdown)
- KaTeX for regulatory math (running annual averages, statistical thresholds, signal scaling)
- Hand-authored inline SVG diagrams, structured JSON-LD metadata
- Deployed on Cloudflare
git clone https://github.com/water-utility/waterutility.org.git
cd waterutility.org
npm install
npm run serve # live-reload dev serverBuild a production copy into _site/:
npm run buildCorrections to regulatory detail, code, or clarity are welcome β open an issue or a pull request. Please keep code runnable and cite the governing rule or method where relevant.
Released under the MIT License.