RationalWiki:OpenSTV

RationalWiki uses the open source OpenSTV software for moderator and foundation elections. This guide provides a technical overview of the election process and assists ballot readers in preparing the election results.

Prerequisites
Install Python 2.7 from python.org.

Install OpenSTV 1.7 from github.

Setup OpenSTV locally as follows:

cd openstv-master python setup.py build python setup.py install cd openstv

Open the election booth
Contact a RationalWiki system administrator, send them the list of candidates, and nicely ask them to open the election booth.

Files
After the system administrator closes the election booth, they transmit a file to the ballot readers that includes the election candidate array and the raw results data. It will look like this:

Dollars", "Bongolian", "GrammarCommie", "LeftyGreenMario", "Oxyaena", "RWRW", "Rationalzombie94", "RightyBlueLuigi", "RipCityLiberal", "Scream!!", "Spud");
 * 1) $wgElectionCandidates = array("Ace McWicked", "Ariel31459", "Avida

13013 1 12 1 3 6 4 9 2 5 8 13 10 11 7 0 66677 1 13 6 3 0 54654 1 7 8 11 3 6 5 13 10 12 4 9 0 12346 1 8 13 4 6 5 3 12 11 10 9 0 77664 1 13 6 4 5 1 12 3 2 9 11 7 10 8 0 80809 1 12 13 6 4 5 0 [...]

The number at the start of each ballot line identifies the identifier of the voting RationalWiki member (in our example above, this data has been randomized for illustrative purposes).

Preparing the data for OpenSTV
Create a text file to be used as the input for OpenSTV. In this example, we will call this file.

The first line says we have 13 candidates and are electing 8.

The next lines are copied from the raw file above with the first number (the RW user identifier) removed.

Following the last ballot entry, add a line with just "0".

The next lines list the candidates in order as specified from  above.

The last line is a name for the election, in this example, "2019 moderator election".

13 8 1 12 1 3 6 4 9 2 5 8 13 10 11 7 0 1 13 6 3 0 1 7 8 11 3 6 5 13 10 12 4 9 0 1 1 8 13 4 6 5 3 12 11 10 9 0 1 13 6 4 5 1 12 3 2 9 11 7 10 8 0 1 12 13 6 4 5 0 1 6 5 11 4 12 13 8 0 1 2 8 1 4 6 5 13 9 3 12 11 10 7 0 1 6 10 1 5 0 1 6 4 13 5 3 12 11 10 1 2 8 7 9 0 1 5 6 10 4 13 9 11 8 3 12 2 1 7 0 1 6 13 5 4 1 11 2 8 10 3 12 9 7 0 1 1 12 3 4 8 13 0 1 1 8 2 9 6 10 12 11 0 1 6 4 5 13 1 3 12 10 11 0 1 6 9 5 7 11 4 0 1 13 6 8 4 3 1 5 2 11 10 9 12 7 0 1 8 3 4 5 0 1 8 1 12 3 2 10 9 0 1 10 6 4 11 5 0 1 6 4 13 11 1 3 12 5 2 10 9 7 8 0 1 6 13 4 5 7 12 3 11 9 8 10 1 2 0 1 6 13 4 5 3 8 1 12 9 10 11 7 2 0 1 6 5 4 13 8 0 1 6 4 13 5 3 9 11 0 1 2 1 4 7 3 6 13 0 1 6 4 13 5 1 12 0 1 6 13 5 4 12 8 1 7 9 10 11 3 0 1 6 4 5 9 10 7 2 11 0 1 13 4 6 5 2 1 11 8 12 10 9 3 7 0 1 7 6 13 5 4 11 0 1 13 4 1 5 8 6 3 0 1 6 5 4 13 0 0 "Ace McWicked" "Ariel" "AvidaDollars" "Bongolian" "GrammarCommie" "LeftyGreenMario" "Oxyaena" "RWRW" "Rationalzombie" "RightyBlueLuigi" "RipCityLiberal" "Scream" "Spud" "2019 moderator election"

Running the ballots
Method:

python runElection.py MeekSTV rw2019mod.blt

Results
If all goes well, the results should be displayed as follows.

Loading ballots from file rat2019.blt. Ballot file contains 13 candidates and 33 ballots. No candidates have withdrawn. Ballot file contains 33 non-empty ballots. Counting votes for RationalWiki 2019 Moderator Election using Meek STV. 13 candidates running for 8 seats. R|Ace McWicke|Ariel31459 |Avida Dolla|Bongolian |GrammarComm|LeftyGreenM |d         |           |rs         |           |ie         |ario |---+---+---+---+---+---  |Oxyaena    |RWRW       |Rationalzom|RightyBlueL|RipCityLibe|Scream!! |          |           |bie94      |uigi       |ral        | |---+---+---+---+---+---  |Spud       |Exhausted  |Surplus    |Threshold |          |           |           |            ==========================================================================  1|   3.000000|   2.000000|   0.000000|   0.000000|   1.000000|  15.000000   |   2.000000|   2.000000|   0.000000|   1.000000|   0.000000|   2.000000   |   5.000000|   0.000000|  12.666666|   3.666667   |---   | Count of first choices. Candidates LeftyGreenMario and Spud have | reached the threshold and are elected. ========================================================================== 2|   3.000000|   2.000000|   0.201480|   5.671102|   3.669625|   3.862230   |   2.000000|   2.201480|   0.755555|   1.755555|   0.000000|   2.000000   |   5.882966|   0.000007|   4.419259|   3.666666   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: LeftyGreenMario, 0.244445 and Spud, | 0.733334. Candidates Bongolian and GrammarCommie have reached the | threshold and are elected. ========================================================================== 3|   3.192371|   2.000118|   0.417291|   4.491072|   5.707464|   3.903734   |   2.000118|   2.417055|   0.768150|   1.768550|   0.147983|   2.000118   |   4.185824|   0.000152|   3.621494|   3.666650   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Bongolian, 0.646553; GrammarCommie, | 0.999194; LeftyGreenMario, 0.232068; and Spud, 0.457064. ========================================================================== 4|   3.600215|   2.079277|   0.706757|   4.325370|   4.218728|   3.801480   |   2.079278|   2.548201|   0.914239|   2.062059|   0.501427|   2.079278   |   4.004389|   0.079302|   1.718543|   3.657856   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Bongolian, 0.527866; GrammarCommie, | 0.641913; LeftyGreenMario, 0.217974; and Spud, 0.400374. ========================================================================== 5|   3.843307|   2.123044|   0.870373|   3.865493|   4.002101|   3.711829   |   2.123044|   2.624285|   0.984254|   2.140684|   0.627908|   2.123044   |   3.837559|   0.123075|   0.995329|   3.652992   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Bongolian, 0.446403; GrammarCommie, | 0.556572; LeftyGreenMario, 0.209739; and Spud, 0.365727. Candidate Ace | McWicked has reached the threshold and is elected. ========================================================================== 6|   3.769053|   2.147137|   0.966003|   3.757535|   3.782295|   3.679228   |   2.147137|   2.772660|   1.019304|   2.184011|   0.696785|   2.211225   |   3.720443|   0.147184|   0.456989|   3.650313   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.950482; Bongolian, | 0.421863; GrammarCommie, 0.508022; LeftyGreenMario, 0.206415; and | Spud, 0.348138. ========================================================================== 7|   3.699260|   2.157500|   1.008599|   3.689752|   3.709233|   3.660379   |   2.157501|   2.855743|   1.034416|   2.200527|   0.726839|   2.261991   |   3.680718|   0.157542|   0.193527|   3.649163   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.920539; Bongolian, | 0.409826; GrammarCommie, 0.490295; LeftyGreenMario, 0.204793; and | Spud, 0.341576. ========================================================================== 8|   3.983710|   2.170015|   1.033152|   3.855863|   3.709233|   3.660379   |   2.157501|   2.855743|   1.034416|   2.200527|           |   2.501200   |   3.680718|   0.157543|   0.644093|   3.649162   |---   | Count after eliminating RipCityLiberal and transferring votes. All | losing candidates are eliminated. ========================================================================== 9|   3.705283|   2.192922|   1.103309|   3.668141|   3.730168|   3.655905   |   2.166777|   3.039487|   1.048012|   2.207793|           |   2.628009   |   3.687375|   0.166819|   0.206212|   3.648132   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.843234; Bongolian, | 0.387857; GrammarCommie, 0.482355; LeftyGreenMario, 0.204166; and | Spud, 0.338648. ========================================================================== 10|  3.670368|   2.200975|   1.129289|   3.671203|   3.666420|   3.653235   |   2.171808|   3.077466|   1.054643|   2.216898|           |   2.658290   |   3.657555|   0.171850|   0.080916|   3.647573   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.830228; Bongolian, | 0.385742; GrammarCommie, 0.471747; LeftyGreenMario, 0.203732; and | Spud, 0.335044. ========================================================================== 11|  3.656880|   2.203967|   1.138811|   3.653861|   3.658328|   3.649086   |   2.173600|   3.091998|   1.057296|   2.219311|           |   2.669975   |   3.653245|   0.173642|   0.034530|   3.647374   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.825072; Bongolian, | 0.383260; GrammarCommie, 0.469323; LeftyGreenMario, 0.203417; and | Spud, 0.334130. ========================================================================== 12|  3.656880|   2.203967|   1.138811|   3.653861|   4.032182|   3.649086   |   2.596328|   3.091998|           |   2.480024|           |   2.669975   |   3.653245|   0.173643|   0.408384|   3.647374   |---   | Count after eliminating Rationalzombie94 and transferring votes. All | losing candidates are eliminated. ========================================================================== 13|  3.656880|   2.203967|           |   3.653861|   4.032182|   3.649086   |   2.596328|   3.265598|           |   2.480024|           |   2.931166   |   3.653245|   0.877663|   0.799509|   3.569149   |---   | Count after eliminating Avida Dollars and transferring votes. All | losing candidates are eliminated. ========================================================================== 14|  3.662599|   2.235747|           |   3.671717|   3.626894|   3.586599   |   2.665588|   3.371606|           |   2.562260|           |   3.063325   |   3.619432|   0.934233|   0.352921|   3.562864   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.805278; Bongolian, | 0.374375; GrammarCommie, 0.415429; LeftyGreenMario, 0.198961; and | Spud, 0.326439. ========================================================================== 15|  3.603182|   2.249680|           |   3.587141|   3.607895|   3.569470   |   2.680137|   3.443679|           |   2.579662|           |   3.137975   |   3.586161|   0.955018|   0.151079|   3.560554   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.783350; Bongolian, | 0.363277; GrammarCommie, 0.408095; LeftyGreenMario, 0.197645; and | Spud, 0.321338. ========================================================================== 16|  4.547291|           |           |   3.665844|   3.607895|   3.569470   |   2.818083|   4.532599|           |   2.579662|           |   3.137975   |   3.586161|   0.955020|   2.145936|   3.560554   |---   | Count after eliminating Ariel31459 and transferring votes. All losing | candidates are eliminated. Candidate RWRW has reached the threshold | and is elected. ========================================================================== 17|  3.926254|           |           |   3.799545|   3.717885|   3.603095   |   2.941031|   3.933806|           |   2.694280|           |   3.654454   |   3.614528|   1.115122|   1.450212|   3.542765   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.613368; Bongolian, | 0.352843; GrammarCommie, 0.402741; LeftyGreenMario, 0.197152; RWRW, | 0.785544; and Spud, 0.319044. Candidate Scream!! has reached the | threshold and is elected. ========================================================================== 18|  3.747964|           |           |   3.688052|   3.688353|   3.584218   |   3.029537|   3.724433|           |   2.823231|           |   3.840247   |   3.629694|   1.244271|   1.204056|   3.528415   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.553459; Bongolian, | 0.328998; GrammarCommie, 0.383772; LeftyGreenMario, 0.193851; RWRW, | 0.707457; Scream!!, 0.969438; and Spud, 0.312710. ========================================================================== 19|  3.683477|           |           |   3.652549|   3.645142|   3.571518   |   3.101536|   3.683364|           |   2.967724|           |   3.711070   |   3.613216|   1.370404|   0.959536|   3.514400   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.521039; Bongolian, | 0.314758; GrammarCommie, 0.367131; LeftyGreenMario, 0.190833; RWRW, | 0.670224; Scream!!, 0.890719; and Spud, 0.303985. ========================================================================== 20|  3.632371|           |           |   3.610690|   3.610783|   3.547792   |   3.160531|   3.629713|           |   3.089200|           |   3.662000   |   3.578434|   1.478486|   0.755046|   3.502391   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.497123; Bongolian, | 0.302854; GrammarCommie, 0.353963; LeftyGreenMario, 0.187782; RWRW, | 0.639480; Scream!!, 0.843515; and Spud, 0.295672. ========================================================================== 21|  3.590854|           |           |   3.575611|   3.576237|   3.528548   |   3.208448|   3.591887|           |   3.192957|           |   3.615076   |   3.552477|   1.567905|   0.583498|   3.492456   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.479335; Bongolian, | 0.293771; GrammarCommie, 0.343338; LeftyGreenMario, 0.185379; RWRW, | 0.617049; Scream!!, 0.806751; and Spud, 0.289389. ========================================================================== 22|  3.558889|           |           |   3.547808|   3.548876|   3.512626   |   3.245927|   3.560195|           |   3.277509|           |   3.577741   |   3.530633|   1.639796|   0.445492|   3.484468   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.466201; Bongolian, | 0.286940; GrammarCommie, 0.335295; LeftyGreenMario, 0.183483; RWRW, | 0.599968; Scream!!, 0.779387; and Spud, 0.284500. ========================================================================== 23|  3.533960|           |           |   3.525933|   3.527075|   3.499807   |   3.274915|   3.535506|           |   3.344635|           |   3.548632   |   3.513344|   1.696193|   0.336850|   3.478201   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.456453; Bongolian, | 0.281818; GrammarCommie, 0.329210; LeftyGreenMario, 0.182013; RWRW, | 0.587207; Scream!!, 0.759069; and Spud, 0.280781. ========================================================================== 24|  3.514980|           |           |   3.509107|   3.510149|   3.489762   |   3.297027|   3.516365|           |   3.396875|           |   3.526130   |   3.499868|   1.739737|   0.252820|   3.473363   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.449252; Bongolian, | 0.278003; GrammarCommie, 0.324649; LeftyGreenMario, 0.180890; RWRW, | 0.577690; Scream!!, 0.744004; and Spud, 0.277973. ========================================================================== 25|  3.500591|           |           |   3.496319|   3.497183|   3.482005   |   3.313739|   3.501785|           |   3.436917|           |   3.509028   |   3.489527|   1.772906|   0.188692|   3.469678   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.443933; Bongolian, | 0.275172; GrammarCommie, 0.321247; LeftyGreenMario, 0.180040; RWRW, | 0.570626; Scream!!, 0.732871; and Spud, 0.275868. ========================================================================== 26|  3.489807|           |           |   3.486673|   3.487366|   3.476118   |   3.326275|   3.490756|           |   3.467274|           |   3.496111   |   3.481689|   1.797931|   0.140618|   3.466897   |---   | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: Ace McWicked, 0.440013; Bongolian, | 0.273076; GrammarCommie, 0.318721; LeftyGreenMario, 0.179403; RWRW, | 0.565395; Scream!!, 0.724653; and Spud, 0.274299. Candidate | RightyBlueLuigi has reached the threshold and is elected. Winners are Ace McWicked, Bongolian, GrammarCommie, LeftyGreenMario, RWRW, RightyBlueLuigi, Scream!!, and Spud.