2020-12-24 18:52:29 +11:00
# 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 ](http://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf ), and can count votes using:
* weighted inclusive Gregory STV (e.g. [Scottish STV ](https://www.opavote.com/methods/scottish-stv-rules ))
2020-12-31 02:14:12 +11:00
* unweighted inclusive Gregory STV (e.g. [Australian Senate STV ](https://www.legislation.gov.au/Details/C2020C00400/Html/Text#_Toc59107700 ))
2021-01-04 17:51:24 +11:00
* exclusive Gregory STV (e.g. [PRSA 1977 ](https://www.prsa.org.au/rule1977.htm ) and [ERS97 ](https://www.electoral-reform.org.uk/latest-news-and-research/publications/how-to-conduct-an-election-by-the-single-transferable-vote-3rd-edition/ ))
2021-01-16 02:28:53 +11:00
* [Meek STV ](http://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf ) – with [tree-packed ballots ](http://www.votingmatters.org.uk/ISSUE21/I21P1.pdf ) for efficient computation
2020-12-24 18:52:29 +11:00
* [Wright STV ](https://www.aph.gov.au/Parliamentary_Business/Committees/House_of_Representatives_Committees?url=em/elect07/subs/sub051.1.pdf )
pyRCV2 is highly customisable, including options for:
* different quotas and quota rules (e.g. exact Droop, Hare) or progressively reducing quota
2021-01-14 22:31:24 +11:00
* calculations using fixed-point arithmetic, guarded fixed-point ([quasi-exact](http://www.votingmatters.org.uk/ISSUE24/I24P2.pdf)) or exact rational numbers
2020-12-24 18:52:29 +11:00
* different tie breaking rules (backwards, random, manual) with auditable deterministic random number generation
* extensible API for other counting methods
2020-12-24 20:23:55 +11:00
## 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 ](https://yingtongli.me/blog/2020/12/24/pyrcv2.html ) 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 ](https://yingtongli.me/git/pyRCV2/about/docs/options.md ).
2021-01-10 18:31:59 +11:00
Once the count is complete, you can click *Print result* to generate a printable result report.
2020-12-24 20:23:55 +11:00
## 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` .