Python/JavaScript framework for counting various preferential voting elections
This repository has been archived on 2021-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
RunasSudo 29c15645b4
Fix bug in STV implementation
Do not allow surplus transfers to interrupt a candidate exclusion
2020-12-31 01:51:13 +11:00
docs Separate out parcel handling logic 2020-12-29 02:43:37 +11:00
html Implement exclusion of parcels by value + Senate STV 2020-12-30 02:33:09 +11:00
pyRCV2 Fix bug in STV implementation 2020-12-31 01:51:13 +11:00
tests Add test case based on CSM15 ballot data 2020-12-29 22:55:21 +11:00
.gitignore Make proper HTML interface with presets 2020-10-18 18:58:24 +11:00
COPYING Initial commit 2020-10-17 18:45:12 +11:00
README.md Update documentation 2020-12-28 01:20:14 +11:00
build.sh Begin implementation of tie handling 2020-12-23 22:37:48 +11:00
requirements.txt Add test case based on PRSA ballot data 2020-12-29 22:19:15 +11:00

README.md

pyRCV2

pyRCV2 is an application for counting various preferential voting elections.

pyRCV2 may be used in a number of different ways:

  • as an online web application, no installation or special software required, at https://yingtongli.me/rcv/
  • as a standalone Python command line application
  • as a library within another Python application

Features

pyRCV2 accepts data in the BLT file format, and can count votes using:

pyRCV2 is highly customisable, including options for:

  • different quotas and quota rules (e.g. exact Droop, Hare) or progressively reducing quota
  • calculations using fixed-point arithmetic or exact rational numbers
  • different tie breaking rules (backwards, random, manual) with auditable deterministic random number generation
  • extensible API for other counting methods

Online usage

After preparing the BLT file, head to https://yingtongli.me/rcv/. Select the BLT file, and click Count. pyRCV2 will count the election and display the results in a count sheet. See here for more detailed instructions.

By clicking Show advanced options, you can customise the options used for the count. A detailed explanation of the various options can be found here.

Command line usage

pyRCV2 may also be invoked as a command line application. Run python -m pyRCV2 --help to view help.

For example, run python -m pyRCV2 stv path/to/blt_file.blt --ties backwards --ties random --random-seed foobar.