civic-geo-generator
Lightweight CLI and library to build web-optimized GeoJSON for election precincts (and similar layers).
Outputs three artifacts per run:
- full GeoJSON (QA and reproducibility)
- web GeoJSON (served to apps)
- TopoJSON (optional, for smaller delivery)
It also writes per-version metadata.json, and a state index.json that points to the latest layer.
Installation
pip install civic-geo-generator
Quick start
# install deps
uv sync --extra dev --extra docs --upgrade
# orchestrated runs based on yaml file
uv run civic-gen run -f inputs.yaml
# or provide a specific state and view
uv run civic-gen run MN precincts
Conventions
- Batch inputs live in
inputs.yaml. - Config files live under
data-config/(e.g.,us/mn/precincts.yaml). - Data input files should be placed in the
data-infolder, organized by state and layer as described in YAML configs (e.g.,data-config/us/mn/precincts.yaml). - Outputs are written under
data-out/us/<state-name>/<view>/<version>/.
Links
- Source: https://github.com/civic-interconnect/civic-geo-generator
- Issues: https://github.com/civic-interconnect/civic-geo-generator/issues
Pipeline
Place statewide GeoJSON input in correct location, e.g.
- data-in/us/mn/precincts_2025-04.json
Configure inputs.yaml, e.g.
# inputs.yaml (batch mode)
runs:
- state: MN
views: [precincts]
version_overrides:
precincts: "2025-04"
# 1) Build (copy/normalize/add snapshot metadata)
civic-gen build --version 2025-04
# 2) Validate (CRS, required columns, geometry, basic uniqueness)
civic-gen validate --version 2025-04
# 3) Index (flat index, manifest, state layer pointers)
civic-gen index
Development
See DEVELOPER.md
Available: Minnesota Precincts
They include voting precinct boundaries as well as the name, county, and election districts (US Congress, MN Senate and House, County Commissioner) for each precinct.
Geojson files are intended to provide basic information regarding the location of election districts within the state. For the most accurate information on precincts and districts, as well as polling place information, please use the Polling Place Finder.
Minnesota precincts - April 2025 (6225 KB json)
| Congressional District | as of April 2025 |
|---|---|
| District 1 (southern Minnesota) | C.D. 1 (1062 KB json) |
| District 2 (south Metro) | C.D. 2 (383 KB json) |
| District 3 (greater Hennepin County) | C.D. 3 (341 KB json) |
| District 4 (Ramsey County and suburbs) | C.D. 4 (217 KB json) |
| District 5 (Minneapolis and suburbs) | C.D. 5 (171 KB json) |
| District 6 (northwestern Metro, St Cloud area) | C.D. 6 (578 KB json) |
| District 7 (western Minnesota) | C.D. 7 (1760 KB json) |
| District 8 (northeastern Minnesota) | C.D. 8 (1720 KB json) |
Metadata
Release files for civic-geo-generator 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| civic_geo_generator-0.1.3.tar.gz | 169.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| civic_geo_generator-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 196.7 kB
Release files / civic_geo_generator-0.1.3.tar.gz
| Download URL | civic_geo_generator-0.1.3.tar.gz |
|---|---|
| Size | 169.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b18c5b98a42a26cab21d2195e4019e0990f020338d6677fe99faa75c97725d4
|
|
BLAKE2b-256 checksum How to use checksums |
d419a28ce2f6ec410bef24c585eb6c41b55b184469bea0a38fbc059c2ce0fbdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Nov 8, 2025.
Transparency logRelease files / civic_geo_generator-0.1.3-py3-none-any.whl
| Download URL | civic_geo_generator-0.1.3-py3-none-any.whl |
|---|---|
| Size | 26.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35f0f2106df89bb8c1ea6b3183f5d92b334e5f14e6b05f61bcd31b73c2e64b05
|
|
BLAKE2b-256 checksum How to use checksums |
1478e3f6160cea91378f3d565b38a52c9a0a7fbd6ee8c2319b96d5f37763421e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Nov 8, 2025.
Transparency logSecurity for civic-geo-generator 0.1.3
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for civic_geo_generator-0.1.3.tar.gz
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 Nov 8, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.