Skip to main content

Tabulate ballots from ranked-choice elections

Project description

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([
    ("Kamala", "Amy", "Elizabeth"),
    ("Kamala", "Elizabeth", "Amy"),
    ("Kamala", "Elizabeth", "Amy"),
])

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

assert winners == {"Kamala", "Elizabeth"}

Project details


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)

Uploaded source

Built Distribution

rcv-0.1.2-py3-none-any.whl (8.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page