{"id":18931968,"url":"https://github.com/crflynn/voting","last_synced_at":"2025-10-08T20:29:04.379Z","repository":{"id":50189510,"uuid":"116529484","full_name":"crflynn/voting","owner":"crflynn","description":"Diversity / (dis)proportionality measures, election quotas, and apportionment methods in pure Python.","archived":false,"fork":false,"pushed_at":"2022-12-08T05:52:17.000Z","size":166,"stargazers_count":15,"open_issues_count":14,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T23:43:25.507Z","etag":null,"topics":["apportionment","diversity-measures","elections","voting"],"latest_commit_sha":null,"homepage":"https://voting.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crflynn.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-07T01:54:11.000Z","updated_at":"2024-10-16T20:20:05.000Z","dependencies_parsed_at":"2023-01-25T04:15:22.157Z","dependency_job_id":null,"html_url":"https://github.com/crflynn/voting","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fvoting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fvoting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fvoting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fvoting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crflynn","download_url":"https://codeload.github.com/crflynn/voting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248593956,"owners_count":21130312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apportionment","diversity-measures","elections","voting"],"created_at":"2024-11-08T11:47:30.752Z","updated_at":"2025-10-08T20:28:59.359Z","avatar_url":"https://github.com/crflynn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"voting\n======\n\n|travis| |rtd| |codecov| |pypi| |pyversions|\n\n\n.. |travis| image:: https://img.shields.io/travis/crflynn/voting.svg\n    :target: https://travis-ci.org/crflynn/voting\n\n.. |rtd| image:: https://img.shields.io/readthedocs/voting.svg\n    :target: http://voting.readthedocs.io/en/latest/\n\n.. |codecov| image:: https://codecov.io/gh/crflynn/voting/branch/master/graphs/badge.svg\n    :target: https://codecov.io/gh/crflynn/voting\n\n.. |pypi| image:: https://img.shields.io/pypi/v/voting.svg\n    :target: https://pypi.python.org/pypi/voting\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/voting.svg\n    :target: https://pypi.python.org/pypi/voting\n\n\nA pure Python module for election quotas, voting measures, and apportionment\nmethods.\n\nInstallation\n------------\n\nThe ``voting`` package works in Python 2.7, 3.5, 3.6 and 3.7. It is available on\npypi and can be installed using pip.\n\n.. code-block:: shell\n\n    pip install voting\n\nPackage structure\n-----------------\n\n* voting\n\n  * apportionment\n\n    * adams\n    * dhondt\n    * hagenbach_bischoff\n    * hamilton\n    * huntington_hill\n    * jefferson\n    * sainte_lague\n    * vinton\n    * webster\n\n  * diversity\n\n    * berger_parker\n    * general\n    * gini_simpson\n    * golosov\n    * inverse_simpson\n    * laakso_taagepera\n    * renyi\n    * shannon\n    * simpson\n\n  * proportion\n\n    * adjusted_loosemore_hanby\n    * dhondt\n    * gallagher\n    * grofman\n    * least_square\n    * lijphart\n    * loosemore_hanby\n    * rae\n    * regression\n    * rose\n    * sainte_lague\n\n  * quota\n\n    * droop\n    * hagenbach_bischoff\n    * hare\n    * imperiali\n\nExamples\n--------\n\nApportioning seats using the Huntington-Hill method.\n\n.. code-block:: python\n\n    from voting import apportionment\n\n\n    votes = [2560, 3315, 995, 5012]\n    seats = 20\n    assignments = apportionment.huntington_hill(votes, seats)\n\n\nCalculating the effective number of parties using Golosov's measure.\n\n.. code-block:: python\n\n    from voting import diversity\n\n\n    parties = [750, 150, 50, 50]\n    effective_parties = diversity.golosov(parties)\n\n\nMeasuring the disproportionality of democratic representation using the\nSainte-Lague measure.\n\n.. code-block:: python\n\n    from voting import proportion\n\n\n    votes = [750, 150, 50, 50]\n    seats = [80, 16, 2, 2]\n    disproportionality = proportion.sainte_lague(votes, seats)\n\nDetermining the Droop quota\n\n.. code-block:: python\n\n    from voting import quota\n\n\n    votes = 1000\n    seats = 20\n    election_quota = quota.droop(votes, seats)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrflynn%2Fvoting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrflynn%2Fvoting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrflynn%2Fvoting/lists"}