ELO-Ratings for your django models
Project description
Django ELO Rating
Installation
python3 -m pip install --user --upgrade django_elo_rating
Configuation
In your settings.py add the following lines
ELO_START_VALUE = 1000
ELO_FACTOR_K = 30
Usage
from django_elo_rating import EloRated
class Player(EloRated):
pass
player_1 = Player()
player_2 = Player()
print(player_1.elo_rating)
# 1000 or whatever you set as ELO_START_VALUE
print(player_2.elo_rating)
# 1000 or whatever you set as ELO_START_VALUE
probability_player_1_wins = player_1.probability(player_2)
print(probability_player_1_wins)
# 0.5
# If player_1 wins a game against player_2
# update player_1's elo rating like this
player_1.elo_rating = player_1.updated_elo(player_2, 1)
# and player_2's like this
player_2.elo_rating = player_2.updated_elo(player_1, 0)
# If they played a draw
player_1.elo_rating = player_1.updated_elo(player_2, 0.5)
player_2.elo_rating = player_2.updated_elo(player_1, 0.5)
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
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 django_elo_rating-0.0.1.tar.gz.
File metadata
- Download URL: django_elo_rating-0.0.1.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0286ce76c4b52bf0e98db9a280a98518a27722409a2d64f84425db1bed8c591f
|
|
| MD5 |
68a4adbee64dfd9b56b08bb3013e7a52
|
|
| BLAKE2b-256 |
ae3088997486bfb950808dcd094bb572845c393fb469a07e03eb17db56334778
|
File details
Details for the file django_elo_rating-0.0.1-py3-none-any.whl.
File metadata
- Download URL: django_elo_rating-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bf10403871915e4c5302f87fd7f0a7c79c32efac329731f492488e3b20d8a1d
|
|
| MD5 |
9c5a84046cad7c9fda60e70e9d6a8273
|
|
| BLAKE2b-256 |
559ef0c09241a66eb1d57d93beff55d4d70369dbd31fc5ad3b4b2004d16f0f79
|