Tabulate ballots from ranked-choice elections
Project description
rcv is a Python library for tabulating ballots from ranked-choice elections. The package is distributed under the BSD 3-Clause License.
Examples
from rcv import FractionalSTV, PreferenceSchedule
schedule = PreferenceSchedule.from_ballots([
("Kamala", "Amy", "Elizabeth"),
("Kamala", "Elizabeth", "Amy"),
("Kamala", "Elizabeth", "Amy"),
])
stv = FractionalSTV(schedule, seats=2)
winners = stv.elect()
assert winners == {"Kamala", "Elizabeth"}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rcv-0.1.2.tar.gz
(5.7 kB
view details)
Built Distribution
rcv-0.1.2-py3-none-any.whl
(8.7 kB
view details)
File details
Details for the file rcv-0.1.2.tar.gz
.
File metadata
- Download URL: rcv-0.1.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ca2105d04bf2b42f13090dd9f56f99984b03b5bdde7c01d3afaf5d0b194f192 |
|
MD5 | a750c66510e99d71bf1fe4260e70cdf6 |
|
BLAKE2b-256 | 5d8c64065de9d4bc2d317ba891471251b5540c353c627621057ccefd6efe4081 |
File details
Details for the file rcv-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: rcv-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72b17454e11dbfeb599e677db42aaa0be408d27c578e37328afaa5d37f0bcdc7 |
|
MD5 | c518e77009f5580a12b9cfef7c20016c |
|
BLAKE2b-256 | 0597968efce3d4d3f4436da576ccd52801e631be96bfe8041adf8ce8491607c1 |