GerryTools

GerryTools

Prepare redistricting data, analyze districting plans, and produce publication-ready figures.


Documentation status PyPI package

GerryTools is a companion to GerryChain. It collects the data, geometry, plotting, LaTeX, and ensemble-runner tools used in practical redistricting workflows. The guides are organized by public module.

Install

Most users can install GerryTools from PyPI:

pip install gerrytools

The Docker-backed ensemble runners are an optional extra:

pip install "gerrytools[mgrp]"

See Installation and environments for uv, virtual-environment, Jupyter, and Docker instructions.

Start here

Install GerryTools

Set up Python, Jupyter, and the optional Docker-backed runners.

Installation and environments
Browse module guides

See how the public modules relate and open the guide for the interface you need.

Module guide
Browse the API

Look up signatures, parameters, and public objects by module.

API reference

Guides by module

Data

Retrieve PL 94-171, ACS, and CVAP tables plus processed 2020 geographic products.

Data
Plan comparison

Move between tabular, geographic, graph, and district-plan representations.

Comparing districting plans
Plotting

Build ensemble distributions, seats-votes figures, maps, and composable Matplotlib layouts.

Plotting
Colors

Use named colors, district palettes, colormaps, and palette previews.

Colors
Ensemble runners

Run ReCom, Forest, and SMC samplers through the Docker-backed MGRP runners.

Ensemble runners (MGRP)
Recording chains

Record GerryChain runs as compact, self-describing BENDL ensemble files.

Recording chains with BEN
Scoring

Score a few GerryChain plans in memory or stream a complete BENDL ensemble.

Scoring
LaTeX output

Produce report tables and TeX-native figures with rendered examples.

LaTeX output