The Chess Tournament Manager is a Python application that facilitates the organization of chess tournaments through the Swiss system. It offers a user-friendly graphical interface for entering player and tournament information, recording player scores for each round, saving and loading the tournament state for future continuation, and viewing tournament reports.
Before running the application, ensure you have Python 3 installed on your system. You can download Python from the official website.
To get started, clone the repository to your local machine:
git clone https://github.com/kenza12/Projet4.git
cd Projet4This application uses only the Python standard library, so there are no external dependencies to install.
To run the Chess Tournament Manager, use the following command:
python3 chess_management.pyOnce the application is running, you can:
- Initiate a new tournament under
Tournament management. Click onCreate New Tournamentand complete the required fields by clicking onSubmit. You can view the tournament details by clicking onView Tournament Details. - Add players under
Player management. You must first create a tournament in step 1 before registering players. ClickRegister a new playeras needed to add all participants, fill in the required fields, and then selectList all playersto see the list of players registered for the current tournament. - After creating a new tournament and registering players or loading a tournament through
Load a tournament, begin the tournament by selectingStart a tournament. Enter the player scores for each Round (1 pt for a win, 0 pt for a loss, 0.5 pt for a draw). The results, along with the updated scores and the start and end times of the round, will be displayed after scoring. You can choose not to proceed to the next Round and save the tournament's current state by clicking onSave a tournamentto continue later. - As mentioned in step 3, you can save the current state of the tournament by clicking
Save a tournamentat any round you wish. The save files will be stored in thedata/tournamentsdirectory in JSON format. - Load a saved tournament from
data/tournamentsto continue or to view a particular tournament report by clicking onLoad a tournamentand selecting the relevant file. - Access reports of a loaded tournament or all created tournaments by clicking
View reports: 6.1.List of all players in all tournamentsdisplays the roster of players from all previously created tournaments without needing to load them. 6.2.List of players in the active tournamentshows the list of players in the ongoing tournament. Load the tournament or create a new one and register players before using this feature. 6.3.View active tournament detailsprovides information about the ongoing tournament. Similar to step 6.2, you must load or create the tournament anew before selection. 6.4.View all tournaments detailsreveals the details of all previously created tournaments. There is no need to load anything; if tournaments are found indata/tournaments, they will be displayed. 6.5.View active rounds and matchespresents all the rounds and matches of the current (or loaded) tournament. Of course, the rounds must have been played to show the results.
The GUI will guide you through the necessary steps to manage your tournament efficiently.
Please note that the Modify Tournament Details and Edit a player features are not implemented yet.
To generate a flake8 HTML report for code quality checks, you will need to have flake8 and the flake8-html plugin installed. If you haven't installed them yet, you can do so by running:
pip install flake8 flake8-htmlAfter installing, you can generate the report by running:
flake8 --format=html --htmldir=flake8-reportThe report will be generated in the flake8-report directory. Open the index.html file in a web browser to view it.