Skip to content
A Python package for tabulating ranked-choice elections.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
rcv
tests
.gitignore
.travis.yml
LICENSE
README.rst
setup.cfg
setup.py

README.rst

rcv

Build Status Code Coverage Documentation Status PyPI Package

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([
    ("A", "B", "C"),
    ("A", "C", "B"),
    ("A", "C", "B"),
])

stv = FractionalSTV(schedule, seats=2)
winners = stv.elect()

assert winners == {"A", "C"}
You can’t perform that action at this time.