Yet another Python Implementation of the Elo rating system.

Overview

Python Implementation - Elo Rating System

Yet another Python Implementation of the Elo rating system (how innovative am I right?). Only supports 1vs1 games at the moment. This whole mini-project/library was just made for me to practice my OOP. I also added the ranking system was just for fun.

What is the Elo Rating System?

  • The Elo rating system is a method for calculating the relative skill levels of players in zero-sum games such as chess. It is named after its creator Arpad Elo, a Hungarian-American physics professor.

How does the Elo Rating System work? How do I calculate Elo?

Check these websites out if you want to learn more on how the Elo Rating System works!

Examples

Creating an Implementation

from elo_system import *
elo = EloSystem(base_elo = 1000, k = 32) # There are the base values for base_elo and k however you can and may change them

Adding and Removing Players

elo.add_player("John")
elo.add_player("Marcus", 1400)

print(elo.get_overall_list())

elo.remove_player("Marcus")

print(elo.get_overall_list())
[{'player': 'Marcus', 'elo': 1400, 'rank': 'Silver'}, {'player': 'John', 'elo': 1000, 'rank': 'Iron'}]
[{'player': 'John', 'elo': 1000, 'rank': 'Iron'}]

Recording a Match

elo.add_player("John")
elo.add_player("Marcus", 1400)

print(elo.get_overall_list())

elo.record_match("Marcus", "John", "Marcus") # 3rd value is the winner

print(elo.get_overall_list())

elo.record_match("Marcus", "John", "John") # Now the winner is John

print(elo.get_overall_list())

elo.record_match("Marcus", "John") # When the winner is not specified, it is considered a draw

print(elo.get_overall_list())
[{'player': 'Marcus', 'elo': 1400, 'rank': 'Silver'}, {'player': 'John', 'elo': 1000, 'rank': 'Iron'}]
[{'player': 'Marcus', 'elo': 1402, 'rank': 'Silver'}, {'player': 'John', 'elo': 997, 'rank': 'Iron'}] 
[{'player': 'Marcus', 'elo': 1372, 'rank': 'Silver'}, {'player': 'John', 'elo': 1026, 'rank': 'Iron'}]
[{'player': 'Marcus', 'elo': 1359, 'rank': 'Silver'}, {'player': 'John', 'elo': 1038, 'rank': 'Iron'}]

Other Useful Methods

elo.add_player("John")
elo.add_player("Marcus", 2400)
elo.add_player("James", 1000)

# There is also set_elo(), reset_elo(), add_elo() and remove_elo()

print(elo.get_overall_list())

print(elo.get_player_elo("John"))

print(elo.get_player_rank("Marcus"))

print(elo.get_player_count())

print(elo.get_players_with_elo(1000))

print(elo.get_players_with_rank("Silver"))
[{'player': 'Marcus', 'elo': 2400, 'rank': 'Grand Master'}, {'player': 'John', 'elo': 1000, 'rank': 'Iron'}, {'player': 'James', 'elo': 1000, 'rank': 'Iron'}]
1000
Grand Master
3
['John', 'James']
[]
Owner
Kraktoos
Meh meh meh Python... Just a noob trying to make it out of Python...
Kraktoos
Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero.

Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with places after the decimal.

Shruti Dhave 2 Nov 29, 2021
Pseudometa's dotfiles

pseudometa's dotfiles Table of Contents Why this repository? How this Repository works Special Explanations Got an idea for an improvement? Contact Wh

pseudometa 23 Dec 27, 2022
Automatically re-open threads when they get archived, no matter your boost level!

ThreadPersist Automatically re-open threads when they get archived, no matter your boost level! Installation You will need to install poetry to run th

7 Sep 18, 2022
Your Google Recon is Now Automated

GRecon : GRecon (Greei-Conn) is a simple python tool that automates the process of Google Based Recon AKA Google Dorking The current Version 1.0 Run 7

adnane-tebbaa 189 Dec 21, 2022
An experimental Python-to-C transpiler and domain specific language for embedded high-performance computing

An experimental Python-to-C transpiler and domain specific language for embedded high-performance computing

Andrea Zanelli 562 Dec 28, 2022
Nick Craig-Wood's Website

Nick Craig-Wood's public website This directory tree is used to build all the different docs for Nick Craig-Wood's website. The content here is (c) Ni

Nick Craig-Wood 2 Sep 02, 2022
Flames Calculater App used to calculate flames status between two names created using python's Flask web framework.

Flames Finder Web App Flames Calculater App used to calculate flames status between two names created using python's Flask web framework. First, App g

Siva Prakash 4 Jan 02, 2022
Collections of python projects

nppy, mostly contains projects written in Python. Some projects are very simple while some are a bit lenghty and difficult(for beginners) Requirements

ghanteyyy 75 Dec 20, 2022
How to create the game Rock, Paper, Scissors in Python

Rock, Paper, Scissors! If you want to learn how to do interactive games using Python, then this is great start for you. In this code, You will learn h

SplendidSpidey 1 Dec 18, 2021
Runtime Type Checking in Python 3

typo This package intends to provide run-time type checking for functions annotated with argument type hints (standard library typing module in Python

Ivan Smirnov 26 Dec 13, 2022
Automate the boilerplate while initializing your Python project

Rubric Automate the boilerplate while initializing your Python project Preface Rubric is an opinionated project initializer for Python. It assum

Redowan Delowar 23 Dec 16, 2022
The fetch of the delegator list and the input of the epoch nonce need to be done independently

raffle The fetch of the delegator list and the input of the epoch nonce need to be done independently. Get the list of delegators at the epoch change.

1 Dec 15, 2021
An animal facts python module

An animal facts python module

Fayas Noushad 3 Dec 19, 2021
My collection of mini-projects in various languages

Mini-Projects My collection of mini-projects in various languages About: This repository consists of a number of small projects. Most of these "mini-p

Siddhant Attavar 1 Jul 11, 2022
Telegram bot to remove the forwarded tag from messages.

Anonymous Sender Bot @AnonySendBot Telegram bot to remove the forwarded tag from messages. Table of Contents Usage Deploy To Heroku Local Deploying En

Stark Bots 26 Nov 24, 2022
A set of scripts for a two-step procedure to measure the value of access to destinations across several modes of travel within a geographic area.

A set of scripts for a two-step procedure to measure the value of access to destinations across several modes of travel within a geographic area.

Institute for Transportation and Development Policy 2 Oct 16, 2022
Comprehensive Python Cheatsheet

Comprehensive Python Cheatsheet

Jure Ĺ orn 31.3k Dec 30, 2022
Artificial intelligence based on 5-dimensional quantum selection

Deep Thought An artificial intelligence based on 5-dimensional quantum selection. Algorithm The payload Make an random bit array (e.g. 1101...) Conver

Larry Holst 3 Dec 14, 2022
Inviare messaggi tramite app IO a partire da dati contenuti in file .csv

parlaConIO Inviare messaggi tramite app IO a partire da dati contenuti in file .csv -- Nessun obbligo, ma in caso di clonazione o uso del programma c

Francesco Del Castillo 6 Aug 22, 2022
A carrot-based color palette you didn't know you needed.

A package to produce a carrot-inspired color palette for python/matplotlib. Install: pip install carrotColors Update: pip install --upgrade carrotColo

10 Sep 28, 2021