Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Report a CivicData Bridge defect
about: Report a Townlight Data defect
title: "[Bug]: "
labels: bug
---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest a CivicData Bridge improvement
about: Suggest a Townlight Data improvement
title: "[Feature]: "
labels: enhancement
---
Expand Down
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CivicData Bridge Agent Instructions
<a id="civicdata-bridge-agent-instructions"></a>

CivicData Bridge prepares municipal datasets for open-data review. Keep v0.1.1 honest: it drafts metadata and checklists, but it does not publish to CKAN, host dashboards, store a data warehouse, or make autonomous redaction/exemption decisions.
# Townlight Data Agent Instructions

Townlight Data prepares municipal datasets for open-data review. Keep v0.1.1 honest: it drafts metadata and checklists, but it does not publish to CKAN, host dashboards, store a data warehouse, or make autonomous redaction/exemption decisions.

## Required verification

Expand All @@ -16,7 +18,7 @@ bash scripts/verify-release.sh

## Dependency boundary

CivicData Bridge may depend on `civiccore==0.3.0`. CivicCore must never import CivicData Bridge. Do not import from CivicCore placeholder packages.
Townlight Data may depend on `civiccore==0.3.0`. Townlight Core must never import Townlight Data Bridge. Do not import from Townlight Core placeholder packages.

## UX and documentation

Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Code of Conduct

CivicData Bridge follows the CivicSuite community expectation: be respectful, constructive, and focused on helping municipalities and residents. Harassment, discriminatory conduct, and bad-faith participation are not welcome.
Townlight Data follows the Townlight community expectation: be respectful, constructive, and focused on helping municipalities and residents. Harassment, discriminatory conduct, and bad-faith participation are not welcome.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Thank you for helping improve CivicData Bridge. Keep contributions small, tested, documented, and honest about shipped versus planned behavior.
Thank you for helping improve Townlight Data Bridge. Keep contributions small, tested, documented, and honest about shipped versus planned behavior.

Before opening a PR, run:

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CivicData Bridge
<a id="civicdata-bridge"></a>

CivicData Bridge is the CivicSuite open-data preparation module. Version 0.1.2 ships the local package, FastAPI runtime, deterministic helper functions, optional database-backed publication workpapers, bearer-token protection for persisted retrieval, tests, release gates, public documentation, and browser-verified sample UI for preparing municipal datasets before human-approved publication.
# Townlight Data

Townlight Data is the Townlight open-data preparation module. Version 0.1.2 ships the local package, FastAPI runtime, deterministic helper functions, optional database-backed publication workpapers, bearer-token protection for persisted retrieval, tests, release gates, public documentation, and browser-verified sample UI for preparing municipal datasets before human-approved publication.

## Shipping in v0.1.2

Expand All @@ -20,12 +22,12 @@ CivicData Bridge is the CivicSuite open-data preparation module. Version 0.1.2 s
- BI dashboards or dashboard hosting.
- Data warehouse storage or long-term operational data storage beyond archive-bundle planning.
- Autonomous redaction or automatic exemption decisions.
- External connector runtime, approval queues, or CivicRecords exemption-engine integration.
- External connector runtime, approval queues, or Townlight Records exemption-engine integration.
- Staff SSO and role-based publication approvals. v0.1.2 protects persisted retrieval only; broader workflow auth comes later.

## Install and run locally

CivicData Bridge v0.1.2 is pinned to `civiccore==0.4.0`.
Townlight Data v0.1.2 is pinned to `civiccore==0.4.0`.

```bash
python -m venv .venv
Expand All @@ -36,7 +38,7 @@ python -m uvicorn civicdata.main:app --host 127.0.0.1 --port 8137

Open `http://127.0.0.1:8137/civicdata` for the browser sample and `http://127.0.0.1:8137/docs` for FastAPI docs.

Set `CIVICDATA_PUBLICATION_DB_URL` to persist CKAN package drafts and publication plans. Set `CIVICDATA_AUTH_TOKEN_ROLES` to a JSON token-to-role map before exposing persisted retrieval. Without the database variable, CivicData Bridge remains deterministic and stateless. Without the auth variable, persisted retrieval endpoints return actionable `503` guidance. With auth configured, anonymous callers receive `401` and callers without an allowed role receive `403`.
Set `CIVICDATA_PUBLICATION_DB_URL` to persist CKAN package drafts and publication plans. Set `CIVICDATA_AUTH_TOKEN_ROLES` to a JSON token-to-role map before exposing persisted retrieval. Without the database variable, Townlight Data remains deterministic and stateless. Without the auth variable, persisted retrieval endpoints return actionable `503` guidance. With auth configured, anonymous callers receive `401` and callers without an allowed role receive `403`.

## API surface

Expand Down Expand Up @@ -64,4 +66,4 @@ bash scripts/verify-release.sh

## Licensing

Code: AGPL-3.0-only, with the TownLight Public Institution Exception for qualifying deployments. See [LICENSE](LICENSE) and [LICENSE-EXCEPTION.md](LICENSE-EXCEPTION.md). Documentation is CC BY 4.0 unless otherwise noted. CivicData Bridge is designed for local municipal operation and does not require outbound runtime calls in the default profile.
Code: AGPL-3.0-only, with the TownLight Public Institution Exception for qualifying deployments. See [LICENSE](LICENSE) and [LICENSE-EXCEPTION.md](LICENSE-EXCEPTION.md). Documentation is CC BY 4.0 unless otherwise noted. Townlight Data is designed for local municipal operation and does not require outbound runtime calls in the default profile.
6 changes: 3 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
CivicData Bridge v0.1.2
Townlight Data v0.1.2

CivicData Bridge prepares municipal datasets for open-data review. It ships dataset normalization, data-dictionary drafts, CKAN package metadata drafts, optional database-backed CKAN package/publication-plan workpapers, bearer-token protection for persisted retrieval, PII/exemption preflight, archive-bundle checklists, publication planning, FastAPI endpoints, tests, docs, and browser QA evidence.
Townlight Data prepares municipal datasets for open-data review. It ships dataset normalization, data-dictionary drafts, CKAN package metadata drafts, optional database-backed CKAN package/publication-plan workpapers, bearer-token protection for persisted retrieval, PII/exemption preflight, archive-bundle checklists, publication planning, FastAPI endpoints, tests, docs, and browser QA evidence.

It does not ship live CKAN publishing, BI dashboards, data warehouse storage, autonomous redaction, or external connector runtime.

Run locally:
python -m pip install -e ".[dev]"
python -m uvicorn civicdata.main:app --host 127.0.0.1 --port 8137

Set CIVICDATA_PUBLICATION_DB_URL to persist CKAN package drafts and publication plans. Set CIVICDATA_AUTH_TOKEN_ROLES to a JSON token-to-role map before exposing persisted retrieval. Without the database variable, CivicData Bridge remains deterministic and stateless. Without the auth variable, persisted retrieval endpoints return actionable 503 guidance. With auth configured, anonymous callers receive 401 and unauthorized roles receive 403.
Set CIVICDATA_PUBLICATION_DB_URL to persist CKAN package drafts and publication plans. Set CIVICDATA_AUTH_TOKEN_ROLES to a JSON token-to-role map before exposing persisted retrieval. Without the database variable, Townlight Data remains deterministic and stateless. Without the auth variable, persisted retrieval endpoints return actionable 503 guidance. With auth configured, anonymous callers receive 401 and unauthorized roles receive 403.

Important routes:
/health
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Report security concerns privately to the maintainers before public disclosure.

CivicData Bridge handles metadata about municipal datasets. Do not place production secrets, raw PII, confidential records, or exempt records in issues, examples, screenshots, or test fixtures.
Townlight Data handles metadata about municipal datasets. Do not place production secrets, raw PII, confidential records, or exempt records in issues, examples, screenshots, or test fixtures.
2 changes: 1 addition & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Support

For CivicData Bridge support, open a GitHub discussion or issue with the module version, operating system, command run, expected result, actual result, and any relevant logs with secrets removed.
For Townlight Data support, open a GitHub discussion or issue with the module version, operating system, command run, expected result, actual result, and any relevant logs with secrets removed.
10 changes: 6 additions & 4 deletions USER-MANUAL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# CivicData Bridge User Manual
<a id="civicdata-bridge-user-manual"></a>

# Townlight Data User Manual

## Non-technical staff guide

CivicData Bridge helps a city prepare datasets before they are published to an open-data portal. It is a preparation and review tool with optional saved CKAN package/publication-plan workpapers, not an automatic publishing robot.
Townlight Data helps a city prepare datasets before they are published to an open-data portal. It is a preparation and review tool with optional saved CKAN package/publication-plan workpapers, not an automatic publishing robot.

### What staff can do today

Expand All @@ -20,7 +22,7 @@ Every dataset still needs staff approval before publication. Staff must confirm

### What v0.1.2 does not do

CivicData Bridge does not publish directly to CKAN, does not host dashboards, does not store a data warehouse, does not make legal exemption decisions, and does not redact records automatically.
Townlight Data does not publish directly to CKAN, does not host dashboards, does not store a data warehouse, does not make legal exemption decisions, and does not redact records automatically.

## IT and technical guide

Expand Down Expand Up @@ -50,7 +52,7 @@ The public endpoints are listed in `README.md`. All v0.1.2 endpoints are determi

### Dependency contract

CivicData Bridge depends on `civiccore==0.4.0`. CivicCore must not import CivicData Bridge.
Townlight Data depends on `civiccore==0.4.0`. Townlight Core must not import Townlight Data Bridge.

### Verification

Expand Down
4 changes: 2 additions & 2 deletions USER-MANUAL.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CivicData Bridge User Manual
Townlight Data User Manual

For staff: CivicData Bridge prepares municipal datasets for open-data review. It normalizes fields, drafts data dictionaries, prepares CKAN package metadata, flags possible PII/exempt fields, creates archive/publication checklists, and optionally retrieves saved CKAN package/publication-plan workpapers.
For staff: Townlight Data prepares municipal datasets for open-data review. It normalizes fields, drafts data dictionaries, prepares CKAN package metadata, flags possible PII/exempt fields, creates archive/publication checklists, and optionally retrieves saved CKAN package/publication-plan workpapers.

Staff must approve every dataset before publication. v0.1.2 does not publish to CKAN, host dashboards, store a data warehouse, redact automatically, or make exemption decisions.

Expand Down
2 changes: 1 addition & 1 deletion civicdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""CivicData Bridge v0.1.2 public package."""
"""Townlight Data v0.1.2 public package."""

__version__ = "0.1.2"
2 changes: 1 addition & 1 deletion civicdata/dataset_normalization.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Dataset normalization helpers for CivicData Bridge v0.1.1."""
"""Dataset normalization helpers for Townlight Data v0.1.1."""

from dataclasses import dataclass
import re
Expand Down
14 changes: 7 additions & 7 deletions civicdata/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""FastAPI runtime foundation for CivicData Bridge."""
"""FastAPI runtime foundation for Townlight Data."""

import os

Expand All @@ -25,9 +25,9 @@


app = FastAPI(
title="CivicData Bridge",
title='Townlight Data',
version=__version__,
description="Open-data normalization, CKAN package drafts, archive bundles, and redaction-review support for CivicSuite.",
description='Open-data normalization, CKAN package drafts, archive bundles, and redaction-review support for Townlight.',
)

_publication_repository: PublicationWorkpaperRepository | None = None
Expand Down Expand Up @@ -89,7 +89,7 @@ def root() -> dict[str, str]:
"version": __version__,
"status": "open-data foundation plus publication workpaper persistence",
"message": (
"CivicData Bridge package, API foundation, dataset normalization, data-dictionary drafts, "
"Townlight Data package, API foundation, dataset normalization, data-dictionary drafts, "
"CKAN package metadata drafts, PII/exemption review preflight, archive-bundle checklists, "
"publication planning, optional database-backed CKAN package/publication-plan workpapers, and "
"public UI foundation are online; live CKAN publishing, BI dashboards, data warehouse storage, "
Expand Down Expand Up @@ -166,7 +166,7 @@ def _require_publication_reader(
) -> AuthenticatedPrincipal:
return authorize_bearer_roles(
credentials,
service_name="CivicData Bridge",
service_name='Townlight Data',
feature_name="persisted publication workpaper retrieval",
token_roles_env_var="CIVICDATA_AUTH_TOKEN_ROLES",
allowed_roles={"workpaper_reader", "data_admin"},
Expand All @@ -182,7 +182,7 @@ def get_ckan_package(
raise HTTPException(
status_code=503,
detail={
"message": "CivicData persisted publication retrieval auth is not configured.",
"message": "Townlight Data persisted publication retrieval auth is not configured.",
"fix": (
"Set CIVICDATA_AUTH_TOKEN_ROLES before exposing persisted CKAN package retrieval."
),
Expand Down Expand Up @@ -244,7 +244,7 @@ def get_publication_plan(
raise HTTPException(
status_code=503,
detail={
"message": "CivicData publication workpaper persistence is not configured.",
"message": "Townlight Data publication workpaper persistence is not configured.",
"fix": "Set CIVICDATA_PUBLICATION_DB_URL to retrieve persisted publication plans.",
},
)
Expand Down
12 changes: 6 additions & 6 deletions civicdata/public_ui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Accessible public sample UI for CivicData Bridge."""
"""Accessible public sample UI for Townlight Data."""


def render_public_lookup_page() -> str:
Expand All @@ -10,7 +10,7 @@ def render_public_lookup_page() -> str:
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="data:,">
<title>CivicData Bridge - open data preparation</title>
<title>Townlight Data - open data preparation</title>
<style>
:root{--ink:#17231d;--green:#1e6b4f;--mint:#d9f2e6;--gold:#c4943d;--paper:#fffaf0}
body{margin:0;font-family:"Aptos","Segoe UI",sans-serif;color:var(--ink);background:radial-gradient(circle at 20% 0,#dff7ef,transparent 32rem),linear-gradient(135deg,#eef9f3,var(--paper))}
Expand All @@ -24,17 +24,17 @@ def render_public_lookup_page() -> str:
</head>
<body>
<header>
<p class="eyebrow">CivicSuite / CivicData Bridge</p>
<p class="eyebrow">Townlight / Townlight Data</p>
<h1>Open-data packages with review gates built in.</h1>
<p class="lede">CivicData Bridge v0.1.2 helps staff normalize municipal datasets, draft data dictionaries, prepare CKAN-ready package metadata, protect persisted retrieval with bearer roles, and assemble records-retention archive checklists.</p>
<p class="lede">Townlight Data v0.1.2 helps staff normalize municipal datasets, draft data dictionaries, prepare CKAN-ready package metadata, protect persisted retrieval with bearer roles, and assemble records-retention archive checklists.</p>
<p><span class="badge">Shipping v0.1.2</span></p>
</header>
<main>
<section class="grid" aria-label="CivicData release status">
<section class="grid" aria-label="Townlight Data release status">
<article class="card"><h2>What ships</h2><ul><li>Dataset field normalization.</li><li>Data-dictionary drafting.</li><li>CKAN package metadata drafts.</li><li>PII/exemption redaction preflight.</li><li>Archive-bundle and publication checklists.</li></ul></article>
<article class="card"><h2>Human approval required</h2><p>Every export must clear staff approval, redaction/exemption review, retention checks, and open-data license confirmation before publication.</p></article>
<article class="card"><h2>Boundaries</h2><p>No live CKAN publication, no BI dashboards, no data warehouse, no long-term storage, no autonomous redaction, and no external connector runtime ships in v0.1.2.</p></article>
<article class="card"><h2>Dependency</h2><p>Pinned to <code>civiccore==0.4.0</code>. Retrieval auth uses <code>CIVICDATA_AUTH_TOKEN_ROLES</code>. CivicCore remains dependency-only; it never imports from CivicData.</p></article>
<article class="card"><h2>Dependency</h2><p>Pinned to <code>civiccore==0.4.0</code>. Retrieval auth uses <code>CIVICDATA_AUTH_TOKEN_ROLES</code>. Townlight Core remains dependency-only; it never imports from Townlight Data.</p></article>
</section>
</main>
<footer><p>AGPL-3.0 code. CC BY 4.0 docs. Run locally by the city.</p></footer>
Expand Down
2 changes: 1 addition & 1 deletion civicdata/publication_plan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Scheduled publication planning for CivicData Bridge."""
"""Scheduled publication planning for Townlight Data."""

from dataclasses import dataclass

Expand Down
2 changes: 1 addition & 1 deletion civicdata/redaction_review.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""PII and exemption review helpers for CivicData Bridge."""
"""PII and exemption review helpers for Townlight Data."""

from dataclasses import dataclass

Expand Down
8 changes: 5 additions & 3 deletions docs/IMPLEMENTATION_PLAN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# CivicData Bridge Implementation Plan
<a id="civicdata-bridge-implementation-plan"></a>

# Townlight Data Implementation Plan

## v0.1.0 shipped

Expand All @@ -14,7 +16,7 @@
## Future work

- Staff approval queues.
- CivicCore connector imports.
- CivicRecords exemption-engine integration.
- Townlight Core connector imports.
- Townlight Records exemption-engine integration.
- CKAN handoff adapter after approval.
- Export bundle signing and audit trails.
6 changes: 4 additions & 2 deletions docs/MILESTONES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# CivicData Bridge Milestones
<a id="civicdata-bridge-milestones"></a>

# Townlight Data Milestones

## 0.1.0 Foundation

Expand All @@ -10,7 +12,7 @@ Add staff approval queues, audit trails, and role-aware review states.

## 0.3.x Connector Imports

Use CivicCore connector patterns for controlled source-system imports.
Use Townlight Core connector patterns for controlled source-system imports.

## 0.4.x CKAN Handoff

Expand Down
6 changes: 4 additions & 2 deletions docs/RECONCILIATION.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# CivicData Bridge Reconciliation
<a id="civicdata-bridge-reconciliation"></a>

# Townlight Data Reconciliation

| Source | Decision |
|---|---|
| CivicSuite unified spec | CivicData Bridge prepares open-data packages, archive bundles, and CKAN-ready metadata. |
| Townlight unified spec | Townlight Data prepares open-data packages, archive bundles, and CKAN-ready metadata. |
| Module catalog | Not a BI platform, dashboard host, or data warehouse. |
| v0.1.0 implementation | Ships deterministic preparation helpers only; live publishing remains future work. |
| Licensing | AGPL-3.0-only for code and CC BY 4.0 for documentation. |
Expand Down
8 changes: 5 additions & 3 deletions docs/github-discussions-seed.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# GitHub Discussions Seed Posts

## Welcome to CivicData Bridge
<a id="welcome-to-civicdata-bridge"></a>

CivicData Bridge helps municipalities prepare datasets for open-data review: normalization, data dictionaries, CKAN package drafts, redaction preflight, archive checklists, and publication planning.
## Welcome to Townlight Data

Townlight Data helps municipalities prepare datasets for open-data review: normalization, data dictionaries, CKAN package drafts, redaction preflight, archive checklists, and publication planning.

## What should v0.2.0 prioritize?

Should the next release focus first on approval queues, CivicCore connector imports, CivicRecords exemption-engine integration, or CKAN handoff adapters?
Should the next release focus first on approval queues, Townlight Core connector imports, Townlight Records exemption-engine integration, or CKAN handoff adapters?

## Local deployment notes

Expand Down
Loading
Loading