LaLiga module¶
__init__.py¶
-
laliga.
draw_board
()[source]¶ Draw components of LaLiga game.
Firstly, creates a canvas for the LED matrix using various configurations. Requests games for the day for La Liga and draws various components of the game such as team logos, scores, period, and time.
Also, draws “SCORE!!!” animation for the game if there is an update in the score.
If button is pressed during the execution, it will load the next game. If the game is the last one for the day in La Liga, then it will go to the next league.
- Returns
Return -1 if no favorite game.
- Return type
int
game.py¶
-
class
laliga.game.
Game
(game_info: Dict[str, any], a_name: str, h_name: str)[source]¶ Represent a scheduled La Liga game.
Game object first parses the JSON dict information. Also contains methods to check if the game is of a favorite team.
- Parameters
game_info (Dict[str, any]) – Dictionary generated from JSON object
a_name (str) – Name of away team
h_name (str) – Name of home team
-
get_matchup
() → Dict[str, str][source]¶ Get information of a single game.
Simply game information into a dictionary to be used by the draw_board() function. Returns a dictionary with names for home and away team, game period, game stage, game status, game clock, score.
- Returns
Game information in a dictionary.
- Return type
Dict[str, str]
-
class
laliga.game.
Scores
[source]¶ Scores Class with static function to get scores for the leauge.
-
static
get_scores
() → List[Tuple[str, str]][source]¶ Get a list of favorite scores/games that are on-going or planned for the day.
First, calls for the request of JSON from La Liga API and checks if games are favorites. If so, then it creates Game objects from the data.
- Returns
List of python dicts that contain information of today’s games.
- Return type
List[Tuple[str, str]]
-
static
teams.py¶
Abbreviation information about NHL teams