Tools for online voter registration in the United States of America
MIT License
Tools for online voter registration in the United States of America.
Contains a command-line tool (vote
) and a python library (voter_tools
) to:
Install this library using pip
:
pip install voter-tools
To check whether a voter is registered:
vote check <first-name> <last-name> <zip> <dob YYYY-MM-DD> [--details]
This will tell you whether the user is registered to vote. You can request extra details (registration date, current status, etc.) with the --details
flag. Not all states support all details.
There is also a tool to check every record in a CSV file:
vote check-csv <input-file.csv> [--details]
A new CSV is written to stdout
with the same fields as the input CSV plus extras related to the registration check.
The vote
command contains a number of sub-commands for interacting directly with the Pennsylvania state API.
For instance, to invoke the API's "get available languages" call:
> vote pa get-languages
languages=(Language(code='LANGENG', name='English'), Language(code='LANGSPN', name='Spanish'), Language(code='LANGTCN', name='Chinese'))
Use vote pa --help
for details on available subcommands.
To contribute to this library, first checkout the code. Then create a new virtual environment:
cd voter-tools
python -m venv .venv
source .venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[dev]'
To run tests:
make test
To run a full lint/typecheck/test pass:
make check
We've collected state-specific documents in the docs
directory and will try to keep them up-to-date as state APIs change.