Metadata-Version: 2.4
Name: elochess
Version: 0.3.0
Summary: A simple python package for calculating chess ratings
Author-email: Moritz Eckert <MoritzEckert@web.de>
License: MIT
Project-URL: Homepage, https://github.com/Moritz72/elochess
Project-URL: Repository, https://github.com/Moritz72/elochess
Keywords: chess,tournament
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Games/Entertainment :: Board Games
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0
Provides-Extra: cli
Requires-Dist: typer>=0.25.0; extra == "cli"
Provides-Extra: dev
Requires-Dist: black>=24.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: pytest>=7.2; extra == "dev"
Requires-Dist: pytest-cov>=7.0; extra == "dev"
Requires-Dist: ruff>=0.14; extra == "dev"
Dynamic: license-file

# elochess

[![CI](https://github.com/Moritz72/elochess/actions/workflows/ci.yml/badge.svg)](https://github.com/Moritz72/elochess/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/Moritz72/elochess/branch/main/graph/badge.svg)](https://codecov.io/gh/Moritz72/elochess)
[![Python 3.11](https://img.shields.io/badge/python-3.11+-blue)](https://img.shields.io/badge/python-3.11+-blue)
[![Ruff](https://img.shields.io/badge/linting-ruff-blue)](https://github.com/astral-sh/ruff)
[![mypy](https://img.shields.io/badge/types-mypy-blue)](https://github.com/python/mypy)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

`elochess` is a simple python package for calculating chess ratings.

## Rating Systems

- [FIDE Elo](https://en.wikipedia.org/wiki/Elo_rating_system) used by the [FIDE](https://en.wikipedia.org/wiki/FIDE)
- [Deutsche Wertungszahl](https://de.wikipedia.org/wiki/Deutsche_Wertungszahl) used by the [German Chess Federation](https://www.schachbund.de)

## Installation

```bash
pip install elochess
```

For CLI support:

```bash
pip install elochess[cli]
```

## Usage

### Python

```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

```bash
elochess-cli \
  --current 1500 \
  --opponent 1642 \
  --opponent 1425 \
  --opponent 1432 \
  --score 2.5
```
