bundesliga_tippspiel.utils package

Subpackages

Submodules

bundesliga_tippspiel.utils.bets module

bundesliga_tippspiel.utils.bets.place_bets(user: jerrycan.db.User.User, bets: List[Tuple[str, int, int, str, str, int, int]]) List[Tuple[str, int, int, str, str, int, int]]

Places bets for a user :param user: The betting user :param bets: The bets to place in the form

(league, season, matchday, home_abbrv, away_abbrv,

home_score, away_score)

Returns

A list of successful bets

bundesliga_tippspiel.utils.matchday module

bundesliga_tippspiel.utils.matchday.get_matchday_info(league: str, season: int) Tuple[int, int]

Retrieves information on matchdays :param league: The league for which to retrieve the information :param season: The season for which to retrieve the information :return: The current matchday as well as the maximum matchday

bundesliga_tippspiel.utils.matchday.get_selected_league() Tuple[str, int]
Returns

The league currently selected by the user by means of cookies

bundesliga_tippspiel.utils.matchday.validate_matchday(league: Optional[str], season: Optional[int], matchday: Optional[int]) Optional[Tuple[str, int, int]]

Performs checks that a league/season/matchday combination is valid. Can also fill these values with default values :param league: The league to check :param season: The season to check :param matchday: The matchday to check :return: league, season, matchday if valid, None if invalid

bundesliga_tippspiel.utils.teams module

bundesliga_tippspiel.utils.teams.get_team_data(team_name: str) Tuple[str, str, str, Tuple[str, str]]

Generates team short_names, abbreviations and icon URLs for teams :param team_name: The team’s full name as specified by OpenLigaDB :return: A tuple containing the

name, short_name, abbreviation, svg URL, png URL

bundesliga_tippspiel.utils.teams.wikimedia_icon_urls(path: str, png_size: int = 500) Tuple[str, str]

Generates URL paths to wikimedia-hosted SVG and PNG files :param path: The URL path to the SVG file (without the wikimedia part) :param png_size: The size of the PNG file :return: The URL path to the SVG File, PNG file

Module contents