yincrash / redistricting-tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redistricting-tools

redistricing-tools is a set of Python scripts for use with US legislative redistricting.

Installation

Use the package manager pip to install redistricting-tools.

pip3 install redistricting-tools

Usage

# 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

Contributing

Pull requests are welcome.

License

MIT

Deploy instructions

python3 setup.py bdist_wheel sdist
twine upload dist/*

About

License:MIT License


Languages

Language:Python 100.0%