Public-safe Python toolkit for urban drainage and water-network telemetry QA/QC, automated reporting, synthetic monitoring examples, and optional applied-AI anomaly screening.
The project demonstrates how private operational monitoring workflows can be converted into a clean research-software package using synthetic examples, tests, documentation, and strict publication boundaries.
For a short explanation of the private-to-public conversion strategy and engineering workflow, see docs/case_study.md.
Live-demo scope and deployment notes are available in docs/live_demo.md.
Status: prototype / repository conversion.
The package is suitable for public demonstration and software review. It is not a drop-in replacement for the original operational system.
Try the synthetic urban drainage monitoring demo online:
The demo uses synthetic data only and shows rainfall-event detection, level/flow response summaries, status-rule checks, report outputs, and a synthetic dashboard map.
To run it locally:
streamlit run app.pySee docs/live_demo.md for scope and interpretation notes.
Urban drainage monitoring systems often combine telemetry from remote devices, FTP folders, SCADA-style exports, rainfall gauges, configuration tables, and field metadata. Before those data can support reporting, decision-making, or machine learning, they need reliable QA/QC.
This repository provides a public-safe version of that workflow. It focuses on:
- timestamp parsing and cleaning
- duplicate record detection
- missing-data and last-contact checks
- daily summaries and static HTML/CSV reports
- private-folder auditing without publishing row values
- synthetic monitoring data for public demonstrations
- optional sensor-health anomaly screening
- synthetic monitoring-point map / synthetic network demo generation
This project complements my wider portfolio on engineering monitoring systems, sensor-data QA/QC, anomaly detection, and public-safe research software.
The public workflow starts from synthetic telemetry, applies QA/QC checks, writes static reports, and optionally produces anomaly-screening and map outputs.
The anomaly-screening example uses synthetic telemetry and an explainable robust baseline. It is included as a transparent demonstration, not as a validated production ML model.
The dashboard-style map preview reflects the original private monitoring workflow more closely while remaining public-safe. It includes a dark map-style background, synthetic clustered points, fictional region boundaries, a search box, layer controls, and QA/QC filters. All points, coordinates, IDs, filters, and labels are synthetic.
Private telemetry structure
│
├── local private audit, never committed
├── schema and data-quality checks
└── reusable public-safe utilities
↓
Synthetic telemetry CSVs
↓
cleaning / QA/QC
↓
daily summaries + static HTML/CSV report
↓
optional sensor-health features + anomaly scores
↓
synthetic monitoring-point map / synthetic network demo
The repository uses synthetic data only. The examples are designed to show the workflow without exposing real sites, coordinates, client names, or operational identifiers.
Run:
urban-drainage-qaqc demoExpected output:
examples/outputs/demo/report/
├── report.html
├── report_summary.png
├── summary.csv
└── file_inventory.csv
The report summarises synthetic telemetry files, cleaned records, duplicate timestamps, missing-row estimates, time coverage, and daily QA/QC summaries.
Run:
python examples/ml/run_anomaly_demo.pyExpected output:
examples/outputs/ml_anomaly_demo/
├── anomaly_plot.png
├── anomaly_scores.csv
├── anomaly_summary.csv
└── sensor_health_features.csv
Run:
urban-drainage-qaqc map-demoExpected output:
examples/outputs/synthetic_map/
├── synthetic_monitoring_points.csv
└── synthetic_monitoring_points.html
Open the HTML file locally in a browser to view the public-safe Leaflet map. The map uses fictional point IDs and synthetic coordinates only.
Run:
urban-drainage-qaqc network-demoExpected output:
examples/outputs/network_demo/
├── report.html
├── network_summary.csv
├── event_summary.csv
├── sensor_response_summary.csv
├── status_summary.csv
├── rainfall_level_flow.png
├── synthetic_monitoring_points.html
└── data/
├── rain_gauge_001.csv
├── level_sensor_001.csv
├── level_sensor_002.csv
├── flow_sensor_001.csv
├── battery_status.csv
└── monitoring_points.csv
The network demo shows the end-to-end public workflow: synthetic rainfall and sensor telemetry, event detection, hydraulic response summaries, status-rule checks, report generation, and a dashboard-style map.
conda create -n urban-drainage-qaqc python=3.11 -y
conda activate urban-drainage-qaqc
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pytest -qRun the public QA/QC demo:
urban-drainage-qaqc demoRun the optional applied-AI demo:
python examples\ml\run_anomaly_demo.pyRun the synthetic map demo:
urban-drainage-qaqc map-demoRun the synthetic network demo:
urban-drainage-qaqc network-demoRun code quality checks:
ruff check .Create synthetic telemetry:
urban-drainage-qaqc create-synthetic --output examples/data/synthetic_monitoring_point.csvRun QA/QC over the synthetic example folder:
urban-drainage-qaqc run --input examples/data --output examples/outputs/synthetic_reportAudit a private local folder without publishing row values:
urban-drainage-qaqc audit --input "path/to/private/folder" --output "private_audit"Run the synthetic network demo:
urban-drainage-qaqc network-demoKeep private audit outputs outside Git or in ignored folders.
The applied-AI component is intentionally lightweight and transparent. It is included to show how cleaned telemetry can be converted into basic sensor-health features and screened for anomalous behaviour.
It demonstrates:
- missing-data indicators
- rolling mean and rolling standard deviation
- rate-of-change features
- spike screening
- flat-line detection
- robust anomaly scoring
- compact sensor-health summaries
The default method is an explainable robust baseline, not a validated production ML model. It uses synthetic telemetry only.
Run:
python examples/ml/run_anomaly_demo.pyThe original private workflow produced map-style outputs for monitoring points. The public repository does not include real point maps because those can expose coordinates, client names, project identifiers, and asset IDs.
The synthetic map example demonstrates the same output family safely:
urban-drainage-qaqc map-demoOutputs:
examples/outputs/synthetic_map/
├── synthetic_monitoring_points.csv
└── synthetic_monitoring_points.html
Public-safety rule: only synthetic or anonymised points should be used in public examples.
src/urban_drainage_sensor_toolkit/
├── audit.py # private-folder audit helpers
├── cli.py # command-line interface
├── core.py # core cleaning and QA/QC functions
├── io_utils.py # input/output helpers
├── events.py # rainfall-event detection and response joins
├── hydrology.py # simple hydraulic-response metrics
├── maps.py # public-safe synthetic map generation
├── network_report.py # synthetic network report generation
├── reporting.py # HTML/CSV report and plot generation
├── status_rules.py # stale-data, battery, flatline, level and flow checks
├── synthetic.py # synthetic telemetry generation
├── synthetic_network.py # synthetic multi-sensor network generation
└── ml/ # optional applied-AI anomaly screening
Other important folders:
.github/workflows/ # CI checks
docs/ # public documentation
examples/ # synthetic data and demos
scripts/ # helper scripts
tests/ # automated tests
tools/ # private sampling helpers
This public repository intentionally excludes:
- original operational telemetry
- real
INPUT/,DATA/,REPORT/, orOUTPUT/folders - private samples
- credentials, tokens, pickles, and local configuration files
- real maps, coordinates, client names, project names, or asset identifiers
- generated private reports
The .gitignore is intentionally strict and excludes common private/local artefacts:
INPUT/
DATA/
REPORT/
OUTPUT/
PRIVATE_SAMPLE*/
private_audit*/
private_report*/
credentials.json
*token*
*.pickle
*.pkl
TOPO/
TEMP/
Local validation used during the public-clean release:
python -m pytest -q
urban-drainage-qaqc demo
python examples/ml/run_anomaly_demo.py
urban-drainage-qaqc map-demo
urban-drainage-qaqc network-demo
ruff check .Expected result:
tests pass
demo report generated
anomaly-screening outputs generated
synthetic map generated
synthetic network demo generated
ruff passes
Validation scope and interpretation notes are summarised in docs/validation_notes.md.
- The public examples are synthetic.
- The applied-AI demo is an explainable baseline, not a validated production model.
- The map example uses fictional coordinates only.
- Private operational data should remain outside Git.
- Local private audit results should be reviewed before sharing.
- This repository demonstrates a public-safe workflow conversion, not a full operational replacement.
If you use this repository as a reference for public-safe engineering telemetry workflows, please cite the repository URL:
Sergio Lopez Dubon, Urban Drainage Sensor Data Toolkit, GitHub repository.
https://github.com/sergioald/urban-drainage-sensor-data-toolkit
MIT License.



