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
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multi_elo-2.0.0.tar.gz.
File metadata
- Download URL: multi_elo-2.0.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5129cc4861bd42a5e8cd07ecd89e1e780cb0e9f5c0f22107b1e2c31b92104d55
|
|
| MD5 |
d3f3adef6be4860c5b2843a33ff44f12
|
|
| BLAKE2b-256 |
c9e2cd1b2092154aa671a9f158c27b43fb786b43058bac7848297b4be426db75
|
File details
Details for the file multi_elo-2.0.0-py3-none-any.whl.
File metadata
- Download URL: multi_elo-2.0.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e1f81e18a8333121b97406e8a591cf3ba7b881cede2df9fc4cc2ab9320fe557
|
|
| MD5 |
1c5b54b5f81d242e21d3444d9c11fda8
|
|
| BLAKE2b-256 |
e5cae7a1d407dbe9b3e4ae8f1408f939f33033ffd6bc63b480dd71c96301830b
|