Skip to main content

Civic Signal Kit

CI License: MIT

Civic Signal Kit is a small Python toolkit for turning plain CSV time-series data into transparent public-interest trend summaries.

It is designed for educators, journalists, community groups, public-health communicators, and civic volunteers who need to explain what changed in a dataset without hiding the assumptions.

The toolkit does not give medical, legal, financial, or emergency advice. It summarizes data and exposes the thresholds used for classification.

What It Does

  • Reads a CSV with a date column and a numeric value column.
  • Calculates rolling averages.
  • Compares the latest period with the previous period.
  • Classifies the latest value using user-provided thresholds.
  • Flags simple data-quality issues such as short histories, duplicate dates, and date gaps.
  • Exports a plain-language Markdown or JSON summary with the method and thresholds included.
  • Writes report artifacts to disk for recurring workflows.
  • Can fail a pipeline when data-quality notes are present.
  • Uses only the Python standard library.

Example

Input CSV:

date,value
2026-05-01,12
2026-05-02,14
2026-05-03,16
2026-05-04,20
2026-05-05,22
2026-05-06,24
2026-05-07,26
2026-05-08,31
2026-05-09,34
2026-05-10,38

Command:

python -m civic_signal_kit sample.csv --date-column date --value-column value --format markdown

Output:

# Signal Summary

- Latest date: 2026-05-10
- Latest value: 38.00
- 7-point rolling average: 27.86
- Previous 7-point rolling average: 20.00
- Change: 39.29% increase
- Level: elevated
- Data points used: 10

## Method

- Rolling window: 7 point(s)
- Thresholds: baseline>=0, elevated>=25, high>=50
- Classification uses the highest threshold less than or equal to the latest rolling average.

Install for Local Development

python -m pip install -e .
python -m unittest discover -s tests

CLI

python -m civic_signal_kit path/to/data.csv \
  --date-column date \
  --value-column value \
  --window 7 \
  --threshold baseline=0 \
  --threshold elevated=25 \
  --threshold high=50 \
  --format markdown \
  --output summary.md

Thresholds are inclusive lower bounds. The highest threshold less than or equal to the latest rolling average becomes the level.

Use --fail-on-notes in scheduled checks when date gaps, short histories, duplicate dates, or missing comparison windows should block publication.

Examples

Runnable sample CSVs live in docs/examples.

python -m civic_signal_kit docs/examples/wastewater-signal.csv \
  --date-column date \
  --value-column concentration \
  --threshold baseline=0 \
  --threshold elevated=250 \
  --threshold high=500

Documentation

Project Values

  • Transparent assumptions.
  • Plain language.
  • No hidden dependencies.
  • No analytics, tracking, or remote logging.
  • Useful defaults, but user-owned thresholds.

Roadmap

  • Add examples for attendance and service-demand data.
  • Add chart export.
  • Add localization-friendly message templates.
  • Expand validation reports for messy CSVs.

Contributing

See CONTRIBUTING.md.

License

MIT. See LICENSE.

Metadata

Release files for civic-signal-kit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for civic-signal-kit 0.2.0
File Size Uploaded
civic_signal_kit-0.2.0.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for civic-signal-kit 0.2.0
File Interpreter ABI Platform
civic_signal_kit-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.6 kB

Release files / civic_signal_kit-0.2.0.tar.gz

Download URL civic_signal_kit-0.2.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
869fa6a5b27e6738736f73d19c95c42c92764f9b5362529560f8318f55cbaa29
BLAKE2b-256 checksum
How to use checksums
b443889612d13e266b88d4d1d3a8c804a949b1ddea634365e30f843240ef07c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release files / civic_signal_kit-0.2.0-py3-none-any.whl

Download URL civic_signal_kit-0.2.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cc59cf4a3adf3935c61e461a1348260e504df8c169e9286832b19330085f1ff
BLAKE2b-256 checksum
How to use checksums
a84b0eb65bf4940e9ec5e3b3f5d1d61b8212efa098efd21d2eb81d16b7fa625e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page