Simple API written in Python for managing Glicko2 ratings of players
- Download the code into a directory
- Make sure you have all the requirements which include but are not limited to:
flask
,numpy
- Run
main.py
- If you would like to alter the settings, stop the program by pressing
Ctrl + C
- Edit the
glicko2.properties
file as desired - Run
main.py
and you're good to go!
This is intended to be used by other backends. There are no request headers or body needed currently, so you can just send a GET request as long as the URL contains all the needed parameters.
This is what a /get-all
request and response would look like, for instance:
The floating point numbers in the arrays are the glicko
, rd
, and volatility
in that order.
All parameters are a query in the request URL and required. For example, the parameters are in bold:
example.url/endpoint?key=value&anotherkey=anothervalue
For player names, you may want to input a player ID instead, depending on your needs.
Parameters:
player
: the name of the playeroverride
: whether to override any existing data for that player name (True
orFalse
)
Parameters:
player
: the name of the playeroverride
: whether to override any existing data for that player name (True
orFalse
)glicko
: the rating of the playerrd
: the rating deviation of the playervolatility
: the volatility of the player
Parameters:
player
: the name of the player to remove
Parameters:
player
: the name of the player to get stats of
Returns all of the keys (player names) and values (array [glicko, rd, volatility])
Parameters:
player
: the name of the player to get the percentile of
Parameters:
player
: the name of the player to get the rating of
Parameters:
winner
: the name of the player who wonloser
: the name of the player who lost