Redistricting analytics data & shared code
To get the data locally, clone the repository:
$ git clone https://github.com/rdatools/rdabase
$ cd rdabase
To run the scripts, install the dependencies:
pip install -r requirements.txt
To use the shared code in another project, install the package:
$ pip install rdabase
The data are stored in the data
directory by state.
These pages describe each dataset:
At present, data has been extracted for the 24 states with 7 or more congressional districts: AL, AZ, CA, CO, FL, GA, IL, IN, MD, MA, MI, MN, MO, NJ, NY, NC, OH, PA, SC, TN, TX, VA, WA, and WI. FL uses DRA's corrected precinct shapes (GeoJSON), with intersections removed, and converted to a shapefile, before simplifying them. In the future, we may extract data for other states.
Some shared code and scripts are described here:
The data comes from the following sources:
Some things to be aware of:
extract_shape_data.py
) to approximate the simplification that DRA does, so compactness measurements align.$ pytest