elections — a reasoning module
Elections decided under each counting method, a house's seats shared out, and a disputed count refused, as a DKE Python module you compile into your own store. It is not legal or electoral advice and it certifies no election. You record an election with its candidates and ranked ballots with the number of voters casting each; it concludes the plurality winner, the majority winner, the candidate who beats every other head to head, the one who loses to every other, the Borda winner, and that no candidate beats every other when the head-to-head counts run in a cycle, each with its proof and with the premise that failed, and it concludes no winner while a ballot's count holds a second claim, naming the dispute instead. It reads the winners and the instant-runoff rounds, refusing a tie for last place, and calculates the Hare and Droop quotas, a house's seats by largest remainders and by the D'Hondt, Sainte-Laguë and Huntington–Hill methods in exact whole numbers, refusing a tie for the last seat, and a Huntington–Hill priority.
Licence: MIT. Current version: 1.0.0, released in rev 129.
Get it
The whole release, as one archive:
curl -O https://dke.langsyn.com/source/elections/1.0.0/elections-1.0.0.tar.gz
Its SHA-256: d71c8b97a19c895ebf3f279158574eda549d2f928931a9bde7604eaa7589449a.
Or browse version 1.0.0 file by file.
/source/elections/latest/ always redirects to the current version.
A release's files never change. When the next release supersedes this one, this
version stays served at its URL, marked superseded, so cite the version and the
archive's digest to say exactly which bytes you read, and use latest
for a link that follows each new release.
Current release
- 1.0.0
1 file, released in rev 129