GerryChain

Build Status Code Coverage Documentation Status PyPI Package

GerryChain is a library for using Markov Chain Monte Carlo methods to study the problem of political redistricting. Development of the library began during the 2018 Voting Rights Data Institute (VRDI).

The project is in active development in the mggg/GerryChain GitHub repository, where bug reports and feature requests, as well as contributions, are welcome.

Installation

Supported Python Versions

The most recent version of GerryChain (as of April 2024) supports

  • Python 3.11

  • Python 3.12

  • Python 3.13

If you do not have one of these versions installed on you machine, we recommend that you go to the Python website and download the installer for one of these versions.

Most users can install GerryChain using pip:

pip install gerrychain

For more detailed installation instructions, including instructions for setting up virtual environments, please see the following section: Installation.

We also highly recommend the resources prepared by Daryl R. DeFord of MGGG for the 2019 MIT IAP course Computational Approaches for Political Redistricting.