https://github.com/qwhex/multi_elo
ELO score calculator for more than two players written in Python
https://github.com/qwhex/multi_elo
chess elo multiplayer python3 scoring
Last synced: 5 months ago
JSON representation
ELO score calculator for more than two players written in Python
- Host: GitHub
- URL: https://github.com/qwhex/multi_elo
- Owner: qwhex
- License: apache-2.0
- Created: 2017-02-06T12:53:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-08-30T10:27:43.000Z (almost 6 years ago)
- Last Synced: 2025-11-27T12:52:01.019Z (6 months ago)
- Topics: chess, elo, multiplayer, python3, scoring
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# multi_elo
[](https://travis-ci.org/qwhex/multi_elo)
Python [ELO](https://en.wikipedia.org/wiki/Elo_rating_system) 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
```python
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
```bash
# 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
```