module dbmanager

Inheritance diagram of lightmlboard.dbmanager

Short summary

module lightmlboard.dbmanager

Manages a sqlite3 database to store the results.

source on GitHub

Classes

class

truncated documentation

DatabaseCompetition

Holds the data used for competitions. Tables: Competitions

Properties

property

truncated documentation

Connection

Returns the connexion.

Static Methods

staticmethod

truncated documentation

_col_competitions

_col_players

_col_submissions

_col_teams

_dummy_submissions

Methods

method

truncated documentation

__init__

_init

Creates the tables if not present.

get_competition

Retrieves a competition.

get_competitions

Returns the list of competitions as list of (cpt_id, cpt_name).

get_cpt_id

Returns the list of competation id.

get_player_id

Returns the list of competation id.

get_results

Retrieves the results of a competition.

init_from_options

Initializes the database. It skips a table if it exists.

submit

Adds a submission to the database.

to_df

Returns the content of a table as a dataframe.

Documentation

Manages a sqlite3 database to store the results.

source on GitHub

class lightmlboard.dbmanager.DatabaseCompetition(dbfile)

Bases: Database

Holds the data used for competitions. Tables:

Competitions

  • cpt_id

  • cpt_name

  • metric

  • datafile

  • description

  • expected_values

Teams

  • team_id

  • team_name

Players

  • player_id

  • team_id

  • player_name

  • mail

  • login

  • pwd

Submission

  • cpt_id

  • player_id

  • date

  • filename

  • metric_value

source on GitHub

Parameters:

dbfile – filename or :memory:

source on GitHub

property Connection

Returns the connexion.

source on GitHub

__init__(dbfile)
Parameters:

dbfile – filename or :memory:

source on GitHub

static _col_competitions()
static _col_players()
static _col_submissions()
static _col_teams()
static _dummy_submissions()
_init()

Creates the tables if not present.

source on GitHub

get_competition(cpt_id)

Retrieves a competition.

Parameters:

cpt_id – competition id

Returns:

Competition

source on GitHub

get_competitions()

Returns the list of competitions as list of (cpt_id, cpt_name).

source on GitHub

get_cpt_id()

Returns the list of competation id.

source on GitHub

get_player_id()

Returns the list of competation id.

source on GitHub

get_results(cpt_id)

Retrieves the results of a competition.

Parameters:

cpt_id – competition id

Returns:

a data frame

source on GitHub

init_from_options(filename)

Initializes the database. It skips a table if it exists.

Parameters:

filename – filename

source on GitHub

submit(cpt_id, player_id, data, date=datetime.datetime(2022, 6, 5, 11, 13, 31, 407357))

Adds a submission to the database.

Parameters:
  • cpt_id – competition id

  • player_id – player who did the submission

  • data – data of the submission

The function computes the metric associated to the submission.

source on GitHub

to_df(table)

Returns the content of a table as a dataframe.

source on GitHub