This repository provides a Python implementation of the Schulze method.
-
Install the latest version of Python 3.X (at least version 3.10).
-
Install the required packages:
pip install -r requirements.txt
To rank candidates, import and call:
- either the
compute_ranks()
function, with given signature.
from schulze import compute_ranks
schulze_ranking = compute_ranks(candidate_names, weighted_ranking_orders)
- or the
compute_schulze_ranking()
function, with given signature.
from schulze import compute_schulze_ranking
schulze_ranking = compute_schulze_ranking(candidate_names, ballots)