Skip to content

Student project #3 - Develop a software program in Python with local database (TinyDB) to manage chess tournament event.

License

Notifications You must be signed in to change notification settings

KDerec/chesstournamentmanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Software program in Python

This student project is the #3 of my training.
You can follow the previous here and next one here.

Table of Contents
  1. About The Project
  2. Built With
  3. Installation
  4. Flake8 report
  5. Usage
  6. License
  7. Contact

About The Project

🌱 Developed skills

  • Become familiar with classes and object-oriented programming.
  • Structure the code of a Python program using a MVC (Model-View-Controller) design pattern.
  • Write robust Python code using PEP 8 style guide.
  • Work with a database of JSON type (TinyDB).

📖 Scenario

I recently became a freelance Python developer and the first opportunity to work on a potential client project came when my friend Elie, a member of the local chess club, told me about her recent tournament experience.

📬 -> "It was a total disaster," she says. "After we finished the first round, the Internet stopped working and the tournament director couldn't enter the scores on the results site, someone tried to enter the scores from his phone, but when he tried, he said the site itself was down 😱 ! Finally, the tournament was rescheduled for next week. It was horrible!".

At this point, I suggest that I can help the club 💡 by writing a tool that has the same functionality, but works offline.

Elie talked to Edouard, the chess club organizer, about this and he is interested 🎉.

🚧🚀 Project goal & deliverable

Develop an offline command-line application with local database to manage chess tournament event and display reporting.

The functionalities of the program are :

  • Create tournament with :
    • Name ;
    • location ;
    • date ;
    • time controller (bullet, blitz and rapide) ;
    • and description.
  • Create players with :
    • Last name ;
    • first name ;
    • birthday ;
    • sexe ;
    • and rank.
  • Play tournament and :
    • Select a number of round ;
    • select a number of player ;
    • select players from the local database ;
    • automatic player matchmaking according to swiss system ;
    • put a score for every match ;
    • play every rounds and display the standings !
  • Display reporting of :
    • All actors ;
    • all tournaments ;
    • all players of a tournament ;
    • all rounds of a tournament ;
    • all matchs of a tournament.

Tournaments and players are all save in a local database.

(back to top)

Built With

(back to top)

Installation

  1. Install Python ;
  2. Clone the project in desired directory ;
    git clone https://github.com/KDerec/chesstournamentmanager.git
  3. Change directory to project folder ;
    cd path/to/chesstournamentmanager
  4. Create a virtual environnement (More detail to Creating a virtual environment) ;
    • For Windows :
      python -m venv env
    • For Linux :
      python3 -m venv env
  5. Activate the virtual environment ;
    • For Windows :
      .\env\Scripts\activate
    • For Linux :
      source env/bin/activate
  6. Install package of requirements.txt ;
    pip install -r requirements.txt
  7. Run main.py and let yourself be guided by the application.

(back to top)

Python installation

  1. Install Python. If you are using Linux or macOS, it should be available on your system already. If you are a Windows user, you can get an installer from the Python homepage and follow the instructions to install it:

    • Go to python.org
    • Under the Download section, click the link for Python "3.xxx".
    • At the bottom of the page, click the Windows Installer link to download the installer file.
    • When it has downloaded, run it.
    • On the first installer page, make sure you check the "Add Python 3.xxx to PATH" checkbox.
    • Click Install, then click Close when the installation has finished.
  2. Open your command prompt (Windows) / terminal (macOS/ Linux). To check if Python is installed, enter the following command (this should return a version number.):

    python -V
    # If the above fails, try:
    python3 -V
    # Or, if the "py" command is available, try:
    py -V

(back to top)

Generate HTML reports of flake8 violations

  1. Open a new terminal and change directory to project folder ;
    cd path/to/chesstournamentmanager
  2. Run the below command ;
    flake8 --format=html --htmldir=flake-report
  3. Change directory to flake-report folder ;
    cd ./flake-report
  4. Open index.html.
    index.html
    • With Windows PowerShell :
      ./index.html
    • With Linux to display in the terminal :
      w3m -dump index.html

(back to top)

Usage

Tournament creation and running example

Show the creation of a new tournament, playing of all rounds and the standing display:
tournament-gif

Player creation example

Show the complete creation of a new player:
player-gif

Report display example

Show the display of reportings, like "all the tournaments", "all rounds of a tournaments" or "all actors":
report-gif

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Kévin Dérécusson - kevin.derecusson@outlook.fr

Project Link: https://github.com/KDerec/chesstournamentmanager

(back to top)

This student project is the #3 of my training.
You can follow the previous here and next one here.

About

Student project #3 - Develop a software program in Python with local database (TinyDB) to manage chess tournament event.

Topics

Resources

License

Stars

Watchers

Forks