Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Voting system based on the Borda counting scheme

Project description

The Borda count is a single-winner election method in which voters rank candidates in order of preference. The Borda count determines the winner of an election by giving each candidate a certain number of points corresponding to the position in which he or she is ranked by each voter. Once all votes have been counted the candidate with the most points is the winner. Because it sometimes elects broadly acceptable candidates, rather than those preferred by the majority, the Borda count is often described as a consensus-based electoral system, rather than a majoritarian one.

>>> import borda.count
>>> who_is_superman = borda.count.Election()
>>> calisto = borda.count.Candidate('calisto')
>>> calvin = borda.count.Candidate('calvin')
>>> clark = borda.count.Candidate('clark')
>>> who_is_superman.set_candidates([calisto, calvin])
>>> who_is_superman.add_candidate(clark)
>>> valentine = borda.count.Voter(who_is_superman, 'valentine')
>>> veronica = borda.count.Voter(who_is_superman, 'veronica')
>>> valentine.votes([clark, calisto, calvin])
>>> veronica.votes([clark, calvin, calisto])
>>> who_is_superman.get_winner() is clark
True

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for borda, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size borda-0.1-py2.7.egg (11.1 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size borda-0.1.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page