Skip to content
View water-utility's full-sized avatar

Block or report water-utility

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
water-utility/README.md

WaterUtility.org β€” Water Utility SCADA Data & EPA Compliance Reporting Automation

WaterUtility.org

Production Python for turning high-frequency SCADA telemetry into defensible Safe Drinking Water Act (SDWA) compliance.

🌐 Visit the site β†’


What this is

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.

Who it's for

  • 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.

What's inside

The library is organised into three connected areas, each with focused topics and step-by-step implementation guides:

πŸ› Core Architecture & SDWA Compliance Taxonomy

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).

🌊 SCADA Data Ingestion & Time-Series Sync

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).

πŸ›‘ Violation Detection & Rule Engine Logic

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).

Why it's different

  • 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.

Tech stack

  • 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

Run it locally

git clone https://github.com/water-utility/waterutility.org.git
cd waterutility.org
npm install
npm run serve   # live-reload dev server

Build a production copy into _site/:

npm run build

Contributing

Corrections 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.

License

Released under the MIT License.


www.waterutility.org

Popular repositories Loading

  1. water-utility water-utility Public

    Production Python patterns for automating water-quality monitoring, SDWA validation, EPA violation alerting, DMR generation, and audit trails.

    JavaScript