Module rating.utils

Functions

def extract_games(folder: str, tournament: Tournament, game_database: GameDatabase, player_database: PlayerDatabase, add_home_advantage: bool = True, forfeit_keep_points: bool = True)

Extracts games from pairings files in the specified folder and adds them to the tournament, game database, and player database.

Args

  • folder (str): The path to the folder containing the pairings files.
  • tournament (Tournament): The tournament object to which the extracted games will be added.
  • game_database (GameDatabase): The game database object to which the extracted games will be added.
  • player_database (PlayerDatabase): The player database object used to retrieve player information.
  • forfeit_keep_points (bool, optional): If True, points associated with each player are counted as the given points in case of a forfeit. This allows for custom match results that do not fit the normal points system.
def extract_players(folder: str) ‑> list[Player]

Extracts players' information from a standings file in the specified folder.

Args

  • folder (str): The path to the folder containing the standings file.

Returns

  • list: A list of Player objects representing the extracted players.
def extract_tournament(folder: str) ‑> Tournament

Extracts tournament information from a folder containing Vega XML files.

Args

  • folder (str): The path to the folder containing the Vega XML files.

Returns

  • Tournament: An instance of the Tournament class representing the extracted tournament information.
def extract_tournament_trfx(folder: str) ‑> Tournament

Extracts tournament information from a TRFX file.

Args

  • folder (str): The path to the folder containing the TRFX file.

Returns

  • Tournament: An instance of the Tournament class representing the extracted tournament information.
def set_logging_level(level: str)

Sets the logging level for the logger.

Args

  • level (str): The logging level to set.