This script was designed for a school project with specific requirements and fixed constraints. It was developed in a limited period of time and in this context this project is not intended to evolve that much once "finished". This project is not open to contribution. The following need is fictive.
A friend of mine is a chess club member. The club is dealing with chess tournaments manually. They would like an offline app to manage their tournaments.
The application implements the following features:
- add new players,
- register them to tournaments,
- create tournaments (date, location, number of rounds),
- launch automated and optimal matchmaking,
- start rounds,
- register matches score,
- display reports (list of tournaments, players, matches, etc.) and export them to files,
- and others.
The application :
- is designed using the architectural pattern Model-View-Controller to have a clear separation between the code manipulating data (model) and the one for the user interface (view).
- is solving a SAT-CP* model defined by the matchmaking constraints with ortools. (SAT-CP solver = A Constraint Programming (CP) solver that uses satisfiability (SAT) method.)
- is displaying a pretty and interactive command line user prompt with questionary.
- is loading previous data from JSON files and is doing automatic backup (after each model change). The application does not require internet to work.
- is flake8 compliant.
Tournament registration:
Tournament management menu:
This project is using Python. This application was tested with 3.11
version (and pip 23.0
) on Windows, linux and macOS.
Third-party dependencies are : questionary
, ortools
and optionally flake8-html
(not required by the application).
- Clone this repository:
git clone https://github.com/nanakin/OC-P4-chess-tournament.git chesstournament
- Move to the project directory:
cd chesstournament
- Create a virtual environment (optional):
and activate it:
python3 -m venv venv
.\venv\Scripts\activate # windows source venv/bin/activate # unix and macOS
- Install required packages:
pip install -r requirements.txt
python3 main.py
--data-path
to specify a backup path.
flake8 --max-line-length=119 --format=html --htmldir=flake8_rapport --exclude=venv