redistricing-tools
is a set of Python scripts for use with US legislative redistricting.
Use the package manager pip to install redistricting-tools.
pip3 install redistricting-tools
# Nest House districts into Senate districts. See examples in the nestings folder.
# nestings.csv First column is the senate district and each following column is a nested house district.
nest-districts [-h] blocks.csv nestings.csv output-senate-blocks.csv
# Combine two maps. If there are BLOCKID collisions, warnings are given for the districts in source-two.csv
# that already have set the same BLOCKIDs in source-one.csv
combine-districts [-h] source-one.csv source-two.csv output-blocks.csv
# Remove districts from a map. Useful to create non-overlapping maps to combine using combine-districts
remove-districts [-h] (--remove REMOVE | --keep KEEP) blocks.csv output-blocks.csv
Pull requests are welcome.
python3 setup.py bdist_wheel sdist
twine upload dist/*