Skip to content

MieuxVoter/majority-judgment-library-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Majority Judgment Library for Python

MIT Join the Discord chat at https://discord.gg/rAAQG9S GitHub Actions

Test-driven Python library to help deliberate using Majority Judgment.

The goal is to be scalable, reliable, fast and extensible. We therefore use a score-based algorithm whatsoever.

Installation

Simply use pip as in:

pip install git+https://github.com/MieuxVoter/majority-judgment-library-python

Example Usage

Collect the votes for each Candidate and provide them in the function majority_judgment as is:

>>> from majority_judgment import majority_judgment
>>> data = {
...    'Pizza': [!, 0, 3, 0, 2, 0, 3, 1, 2, 3], 
...    'Chips': [0, 1, 0, 2, 1, 2, 2, 3, 2, 3],
...    'Pasta': [0, 1, 0, 1, 2, 1, 3, 2, 3, 3],
...    'Bread': [0, 1, 2, 1, 1, 2, 1, 2, 2, 3],
... }
>>> majority_judgment(data, reverse=False)
{'Chips': 0, 'Pasta': 1, 'Pizza': 2, 'Bread': 3}

License

MITDo whatever you want except complain.

Majority Judgment itself is part of the Commons, obviously.

Fund us

We'd love to invest more energy in Majority Judgment development.

Please consider funding us, every bit helps : https://www.paypal.com/donate/?hosted_button_id=QD6U4D323WV4S

About

Deliberate using Majority Judgment in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages