Even if it is not available, something like this is not too hard to implement yourself. Here is an example with extremely silly and simple rating system that is just meant to give you an idea. But I don't think that using actual Elo formula that much harder.
EDIT: I edit my implementation to use Elo formula (not including floors) given by the formula here
def get_exp_score_a(rating_a, rating_b):
return 1.0 /(1 + 10**((rating_b - rating_a)/400.0))
def rating_adj(rating, exp_score, score, k=32):
return rating + k * (score - exp_score)
class ChessPlayer(object):
def __init__(self, name, rating):
self.rating = rating
self.name = name
def match(self, other, result):
exp_score_a = get_exp_score_a(self.rating, other.rating)
if result == self.name:
self.rating = rating_adj(self.rating, exp_score_a, 1)
other.rating = rating_adj(other.rating, 1 - exp_score_a, 0)
elif result == other.name:
self.rating = rating_adj(self.rating, exp_score_a, 0)
other.rating = rating_adj(other.rating, 1 - exp_score_a, 1)
elif result == 'Draw':
self.rating = rating_adj(self.rating, exp_score_a, 0.5)
other.rating = rating_adj(other.rating, 1 - exp_score_a, 0.5)
This works as follows:
>>> bob = ChessPlayer('Bob', 1600)
>>> john = ChessPlayer('John', 1900)
>>> bob.rating
1600
>>> john.rating
1900
>>> bob.match(john, 'Bob')
>>> bob.rating
1627.1686541692377
>>> john.rating
1872.8313458307623
>>> mark = ChessPlayer('Mark', 2100)
>>> mark.match(bob, 'Draw')
>>> mark.rating
2085.974306956907
>>> bob.rating
1641.1943472123305
Here is my original python implementation:
class ChessPlayer(object):
def __init__(self, name, rating):
self.rating = rating
self.name = name
def match(self, other, result):
if result == self.name:
self.rating += 10
other.rating -= 10
elif result == other.name:
self.rating += 10
other.rating -= 10
elif result == 'Draw':
pass
This works as follows:
>>> bob = ChessPlayer('Bob', 1600)
>>> john = ChessPlayer('John', 1900)
>>> bob.match(john, 'Bob')
>>> bob.rating
1610
>>> john.rating
1890
>>> mark = ChessPlayer('Mark', 2100)
>>> mark.match(bob, 'Mark')
>>> mark.rating
2110
>>> bob.rating
1600
>>> mark.match(john, 'Draw')
>>> mark.rating
2110
>>> john.rating
1890