Skip to main content

A simple python package for calculating chess ratings.

Project description

♟️ elochess

CI codecov Python 3.11 uv Ruff mypy License: MIT

elochess is a simple python package for calculating chess ratings.

✨ Rating Systems

🎯 Accuracy

This project aims to replicate the exact official rating calulations.

For FIDE Elo and DWZ, the calculated ratings have been confirmed to be accurate in a large number of real scenarios.

For USCF rating, the calculated ratings are an estimate based on the "official" Rating Estimator. Here as well, it has been confirmed to be accurate in a large number of real scenarios. But keep in mind that this is a mere estimate of the real calculation which can only be performed by knowing all results of all players.

📦 Installation

pip install elochess

For CLI support:

pip install elochess[cli]

For API support:

pip install elochess[api]

🚀 Usage

🐍 Python

from elochess.elo import EloCalculator

current_rating = 1500
opponent_ratings = [1642, 1425, 1432]
score = 2.5

new_rating = EloCalculator.update_rating(
    current_rating,
    opponent_ratings,
    score
)

💻 CLI

elochess-cli update elo \
  --current 1500 \
  --opponent 1642 \
  --opponent 1425 \
  --opponent 1432 \
  --score 2.5

🌐 API

elochess-api

Check out the OpenAPI Spec at http://127.0.0.1:8000/docs.

📄 License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elochess-0.5.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elochess-0.5.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file elochess-0.5.0.tar.gz.

File metadata

  • Download URL: elochess-0.5.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for elochess-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4620b1edac9ebf42acaa706fd8583840f9480661da603712fa87da6bff8e3319
MD5 779f65afb46bb73ce1b8cf2405a0d001
BLAKE2b-256 01c569289933b686b49f8817fc79bd22b4bdabd18fc9f8d95ad533562494fe2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for elochess-0.5.0.tar.gz:

Publisher: publish.yml on Moritz72/elochess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file elochess-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: elochess-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for elochess-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00c16d30e67bd16f5eb501351c244c874240e58f3c3aaec810fd0629abfb166c
MD5 b57881d90853564b2649d7544e9c125b
BLAKE2b-256 3c5fd660fc1ab2d7e374c7aab006aeb6625178a0e745bd4e59f4e2b1c7f34d4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for elochess-0.5.0-py3-none-any.whl:

Publisher: publish.yml on Moritz72/elochess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page