bundesliga_tippspiel package

Subpackages

Submodules

bundesliga_tippspiel.Config module

class bundesliga_tippspiel.Config.Config

Bases: jerrycan.Config.Config

Configuration for the flask application

OPENLIGADB_EXTRA_LEAGUES: List[Tuple[str, int]]

Extra openligadb seasons and leagues

OPENLIGADB_LEAGUE: str

The default openligadb league to use

OPENLIGADB_SEASON: str

The default openligadb season to use

classmethod all_leagues() List[Tuple[str, int]]
Returns

A list of all leagues

classmethod environment_variables() Dict[str, List[str]]

Specifies required and optional environment variables :return: The specified environment variables in two lists in

a dictionary, grouped by whether the variables are required or optional

classmethod league_name(league: Optional[str] = None) str

Generates a name for the openligadb league :param league: The league string (like ‘bl1’) :return: The league name (like ‘Bundesliga’)

classmethod league_string(league: str, season: int) str

Creates a league string, like “Bundesliga 2020/21” :param league: The league for which to generate the string :param season: The season for which to generate the string :return: The generated string

classmethod season() int
Returns

The current season

classmethod season_string(year: Optional[int] = None) str
Returns

The season string, e.g. 2020/21 for 2020

bundesliga_tippspiel.enums module

class bundesliga_tippspiel.enums.ReminderType(value)

Bases: enum.Enum

Class that specifies the different reminder types

EMAIL = 'email'
TELEGRAM = 'telegram'

bundesliga_tippspiel.exceptions module

exception bundesliga_tippspiel.exceptions.ActionException(reason: str, display_message: str, status_code: int = 400, severity: jerrycan.enums.AlertSeverity = AlertSeverity.DANGER)

Bases: Exception

An exception that gets raised whenever an action method fails for whatever reason. The reason should be provided as a parameter

__init__(reason: str, display_message: str, status_code: int = 400, severity: jerrycan.enums.AlertSeverity = AlertSeverity.DANGER)

Initializes the Exception while adding the ‘reason’ variable :param reason: The reason for the exception :param display_message: The message to display :param status_code: The status code corresponding to the exception

Defaults to 400

Parameters

severity – The severity of the exception. Defaults to DANGER

flash()

Flashes the message so that it can be displayed on the next redirect :return: None

bundesliga_tippspiel.jinja_extras module

bundesliga_tippspiel.jinja_extras.get_matchday_total_pill_class(points: int) str

Calculates the appropriate pill badge for an amount of points on a matchday :param points: The points for which to get the pill class :return: The appropriate pill badge class

bundesliga_tippspiel.jinja_extras.get_pill_class(points: int) str

Calculates the appropriate pill badge for an amount of points :param points: The points for which to get the pill class :return: The appropriate pill badge class

bundesliga_tippspiel.jinja_extras.jinja_extras() Dict[str, Any]

Makes sure that jinja has access to these variables :return: The variables to forward to jinja

bundesliga_tippspiel.main module

bundesliga_tippspiel.main.main()

Initializes and starts the flask application :return: None

bundesliga_tippspiel.template_extras module

bundesliga_tippspiel.template_extras.profile_extras() Dict[str, Any]

Makes sure that the profile page has access to information on email reminders. :return: The variables to forward to the template

Module contents

bundesliga_tippspiel.root_path: str = '/usr/local/lib/python3.8/dist-packages/bundesliga_tippspiel-2.0.10-py3.8.egg/bundesliga_tippspiel'

The root path of the application

bundesliga_tippspiel.sentry_dsn = 'https://e91e468e84424758bd74e6908af2c565@sentry.namibsun.net/6'

The sentry DSN used for exception logging