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 hashes)
Built Distribution
rcv-0.1.2-py3-none-any.whl
(8.7 kB
view hashes)