ELO score calculator for more than two players
Project description
multi_elo
Python ELO score calculator for more than two players. It can be used e.g. for a 4 player multiplayer match and for team-based games as well.
Install
pip install multi_elo
Compatibility
Python 3.5+
Usage
from random import randint
from multi_elo import EloPlayer, calc_elo
# Generate players with random ELO.
# It can be a list of any elements having the `place` and `elo` properties.
elo_players = [EloPlayer(place=place, elo=randint(1200, 1800))
for place in range(1, 5)]
print('Original ELO scores:')
for player in enumerate(elo_players, start=1):
print(f'{i}: #{player.place} ({player.elo})')
# Set the K factor (optional)
k_factor = 16
# Calculate new ELO scores
new_elos = calc_elo(elo_players, k_factor)
print('\nNew ELO scores:')
for i, new_elo in enumerate(new_elos, start=1):
print(f'{i}: {new_elo}')
Development
# install dependencies
pip install requirements_dev.txt
# run tests with all of the supported python interpreters
tox
# or only with the currently active python interpreter
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
multi_elo-2.0.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for multi_elo-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e1f81e18a8333121b97406e8a591cf3ba7b881cede2df9fc4cc2ab9320fe557 |
|
MD5 | 1c5b54b5f81d242e21d3444d9c11fda8 |
|
BLAKE2b-256 | e5cae7a1d407dbe9b3e4ae8f1408f939f33033ffd6bc63b480dd71c96301830b |