Models Module
Pydantic data models for NHL Scrabble Score Analyzer.
The models module provides type-safe data structures using Pydantic for validation, serialization, and documentation.
Overview
Data models for NHL Scrabble.
- class nhl_scrabble.models.ConferenceStandings(name, total, teams, player_count, avg_per_team)[source]
Bases:
objectRepresents conference-level standings based on Scrabble scores.
- name
Conference name
- total
Total Scrabble score for all teams in the conference
- teams
List of team abbreviations in this conference
- player_count
Total number of players in the conference
- avg_per_team
Average score per team
- to_dict()[source]
Convert to dictionary for JSON serialization.
Examples
>>> standings = ConferenceStandings( ... name="Eastern", ... total=10000, ... teams=["TOR", "MTL", "BOS", "NYR"], ... player_count=100, ... avg_per_team=2500.0 ... ) >>> result = standings.to_dict() >>> result['name'] 'Eastern' >>> len(result['teams']) 4
- __repr__()[source]
Return a string representation of the conference standings.
Examples
>>> standings = ConferenceStandings( ... name="Eastern", ... total=10000, ... teams=["TOR", "MTL", "BOS", "NYR"], ... player_count=100, ... avg_per_team=2500.0 ... ) >>> repr(standings) "ConferenceStandings(name='Eastern', total=10000, teams=4)"
- Return type:
- __init__(name, total, teams, player_count, avg_per_team)
- class nhl_scrabble.models.DivisionStandings(name, total, teams, player_count, avg_per_team)[source]
Bases:
objectRepresents division-level standings based on Scrabble scores.
- name
Division name
- total
Total Scrabble score for all teams in the division
- teams
List of team abbreviations in this division
- player_count
Total number of players in the division
- avg_per_team
Average score per team
- to_dict()[source]
Convert to dictionary for JSON serialization.
Examples
>>> standings = DivisionStandings( ... name="Atlantic", ... total=5000, ... teams=["TOR", "MTL", "BOS"], ... player_count=75, ... avg_per_team=1666.67 ... ) >>> result = standings.to_dict() >>> result['name'] 'Atlantic' >>> len(result['teams']) 3
- __repr__()[source]
Return a string representation of the division standings.
Examples
>>> standings = DivisionStandings( ... name="Atlantic", ... total=5000, ... teams=["TOR", "MTL", "BOS"], ... player_count=75, ... avg_per_team=1666.67 ... ) >>> repr(standings) "DivisionStandings(name='Atlantic', total=5000, teams=3)"
- Return type:
- __init__(name, total, teams, player_count, avg_per_team)
- class nhl_scrabble.models.PlayerScore(first_name, last_name, full_name, first_score, last_score, full_score, team, division, conference)[source]
Bases:
objectRepresents a player with their Scrabble score information.
- first_name
Player’s first name
- last_name
Player’s last name
- full_name
Player’s full name (first + last)
- first_score
Scrabble score for first name
- last_score
Scrabble score for last name
- full_score
Total Scrabble score (first + last)
- team
Team abbreviation (e.g., ‘TOR’, ‘MTL’)
- division
Division name
- conference
Conference name
- to_dict()[source]
Convert to dictionary for JSON serialization.
Note
This is 2-3x faster than dataclasses.asdict() because it uses direct attribute access instead of reflection.
Examples
Convert player to dictionary:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> result = player.to_dict() >>> result['full_name'] 'Connor McDavid' >>> result['full_score'] 35
- __repr__()[source]
Return a string representation of the player.
Examples
String representation:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> repr(player) "PlayerScore(name='Connor McDavid', score=35, team='EDM')"
- Return type:
- __init__(first_name, last_name, full_name, first_score, last_score, full_score, team, division, conference)
- class nhl_scrabble.models.PlayoffTeam(abbrev, total, players, avg, conference, division, seed_type='', in_playoffs=False, division_rank=0, status_indicator='')[source]
Bases:
objectRepresents a team in playoff standings context.
- abbrev
Team abbreviation
- total
Total Scrabble score
- players
Number of players on the team
- avg
Average score per player
- conference
Conference name
- division
Division name
- seed_type
Playoff seed description (e.g., “Atlantic #1”, “Eastern WC1”)
- in_playoffs
Whether team has clinched a playoff spot
- division_rank
Rank within the division (1-based)
- status_indicator
Playoff status (p=Presidents’, z=Conference, y=Division, x=Playoff, e=Eliminated)
- to_dict()[source]
Convert to dictionary for JSON serialization.
Examples
>>> team = PlayoffTeam( ... abbrev="TOR", ... total=500, ... players=25, ... avg=20.0, ... conference="Eastern", ... division="Atlantic", ... seed_type="Atlantic #1", ... in_playoffs=True, ... division_rank=1, ... status_indicator="y" ... ) >>> result = team.to_dict() >>> result['abbrev'] 'TOR' >>> result['in_playoffs'] True
- __repr__()[source]
Return a string representation of the playoff team.
Examples
>>> team = PlayoffTeam( ... abbrev="TOR", ... total=500, ... players=25, ... avg=20.0, ... conference="Eastern", ... division="Atlantic", ... seed_type="Atlantic #1", ... in_playoffs=True, ... division_rank=1, ... status_indicator="y" ... ) >>> repr(team) "PlayoffTeam(abbrev='TOR', seed='Atlantic #1', status='y')"
- Return type:
- __init__(abbrev, total, players, avg, conference, division, seed_type='', in_playoffs=False, division_rank=0, status_indicator='')
- class nhl_scrabble.models.TeamScore(abbrev, name, total, players, division, conference)[source]
Bases:
objectRepresents a team with aggregated Scrabble score information.
- abbrev
Team abbreviation (e.g., ‘TOR’, ‘MTL’)
- name
Team full name (e.g., ‘Maple Leafs’, ‘Canadiens’)
- total
Total Scrabble score for all players on the team
- players
List of all players on the team with their scores
- division
Division name
- conference
Conference name
- avg_per_player
Average score per player (computed)
- players: list[PlayerScore]
- __post_init__()[source]
Calculate average score per player after initialization.
Examples
Automatic calculation of average:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=70, ... players=[player, player], ... division="Pacific", ... conference="Western" ... ) >>> team.avg_per_player 35.0
- Return type:
- to_dict(include_players=True)[source]
Convert to dictionary for JSON serialization.
- Parameters:
include_players (
bool) – Whether to include full player list (default: True)- Return type:
- Returns:
Dictionary representation of team
Examples
Convert team to dictionary (with players):
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=35, ... players=[player], ... division="Pacific", ... conference="Western" ... ) >>> result = team.to_dict() >>> result['abbrev'] 'EDM' >>> 'players' in result True
Convert without players:
>>> result = team.to_dict(include_players=False) >>> 'players' in result False >>> result['player_count'] 1
- property player_count: int
Return the number of players on the team.
Examples
Get player count:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=70, ... players=[player, player], ... division="Pacific", ... conference="Western" ... ) >>> team.player_count 2
- __repr__()[source]
Return a string representation of the team.
Examples
String representation:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=500, ... players=[player], ... division="Pacific", ... conference="Western" ... ) >>> repr(team) "TeamScore(abbrev='EDM', total=500, players=1)"
- Return type:
- __init__(abbrev, name, total, players, division, conference)
Player Models
Player data models.
- class nhl_scrabble.models.player.PlayerScore(first_name, last_name, full_name, first_score, last_score, full_score, team, division, conference)[source]
Bases:
objectRepresents a player with their Scrabble score information.
- first_name
Player’s first name
- last_name
Player’s last name
- full_name
Player’s full name (first + last)
- first_score
Scrabble score for first name
- last_score
Scrabble score for last name
- full_score
Total Scrabble score (first + last)
- team
Team abbreviation (e.g., ‘TOR’, ‘MTL’)
- division
Division name
- conference
Conference name
- to_dict()[source]
Convert to dictionary for JSON serialization.
Note
This is 2-3x faster than dataclasses.asdict() because it uses direct attribute access instead of reflection.
Examples
Convert player to dictionary:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> result = player.to_dict() >>> result['full_name'] 'Connor McDavid' >>> result['full_score'] 35
- __repr__()[source]
Return a string representation of the player.
Examples
String representation:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> repr(player) "PlayerScore(name='Connor McDavid', score=35, team='EDM')"
- Return type:
- __init__(first_name, last_name, full_name, first_score, last_score, full_score, team, division, conference)
Player
Base player information from NHL API.
Fields:
id- Player IDfirstName- Player’s first namelastName- Player’s last namesweaterNumber- Jersey number (optional)positionCode- Position code (e.g., ‘C’, ‘LW’, ‘RW’, ‘D’, ‘G’)headshot- URL to player headshot image
PlayerScore
- class nhl_scrabble.models.player.PlayerScore(first_name, last_name, full_name, first_score, last_score, full_score, team, division, conference)[source]
Bases:
objectRepresents a player with their Scrabble score information.
- first_name
Player’s first name
- last_name
Player’s last name
- full_name
Player’s full name (first + last)
- first_score
Scrabble score for first name
- last_score
Scrabble score for last name
- full_score
Total Scrabble score (first + last)
- team
Team abbreviation (e.g., ‘TOR’, ‘MTL’)
- division
Division name
- conference
Conference name
- to_dict()[source]
Convert to dictionary for JSON serialization.
Note
This is 2-3x faster than dataclasses.asdict() because it uses direct attribute access instead of reflection.
Examples
Convert player to dictionary:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> result = player.to_dict() >>> result['full_name'] 'Connor McDavid' >>> result['full_score'] 35
- __repr__()[source]
Return a string representation of the player.
Examples
String representation:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> repr(player) "PlayerScore(name='Connor McDavid', score=35, team='EDM')"
- Return type:
- __init__(first_name, last_name, full_name, first_score, last_score, full_score, team, division, conference)
Player with calculated Scrabble score.
Fields:
player- Player objectfirst_score- Score for first namelast_score- Score for last nametotal- Total combined score
Example:
from nhl_scrabble.models.player import Player, PlayerScore
from nhl_scrabble.scoring import ScrabbleScorer
player = Player(
id=8478402, firstName="Alexander", lastName="Ovechkin", sweaterNumber=8, positionCode="LW"
)
scorer = ScrabbleScorer()
player_score = scorer.score_player(player)
print(f"{player_score.player.firstName} {player_score.player.lastName}: {player_score.total}")
# Output: Alexander Ovechkin: 45
Team Models
Team data models.
- class nhl_scrabble.models.team.TeamScore(abbrev, name, total, players, division, conference)[source]
Bases:
objectRepresents a team with aggregated Scrabble score information.
- abbrev
Team abbreviation (e.g., ‘TOR’, ‘MTL’)
- name
Team full name (e.g., ‘Maple Leafs’, ‘Canadiens’)
- total
Total Scrabble score for all players on the team
- players
List of all players on the team with their scores
- division
Division name
- conference
Conference name
- avg_per_player
Average score per player (computed)
- players: list[PlayerScore]
- __post_init__()[source]
Calculate average score per player after initialization.
Examples
Automatic calculation of average:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=70, ... players=[player, player], ... division="Pacific", ... conference="Western" ... ) >>> team.avg_per_player 35.0
- Return type:
- to_dict(include_players=True)[source]
Convert to dictionary for JSON serialization.
- Parameters:
include_players (
bool) – Whether to include full player list (default: True)- Return type:
- Returns:
Dictionary representation of team
Examples
Convert team to dictionary (with players):
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=35, ... players=[player], ... division="Pacific", ... conference="Western" ... ) >>> result = team.to_dict() >>> result['abbrev'] 'EDM' >>> 'players' in result True
Convert without players:
>>> result = team.to_dict(include_players=False) >>> 'players' in result False >>> result['player_count'] 1
- property player_count: int
Return the number of players on the team.
Examples
Get player count:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=70, ... players=[player, player], ... division="Pacific", ... conference="Western" ... ) >>> team.player_count 2
- __repr__()[source]
Return a string representation of the team.
Examples
String representation:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=500, ... players=[player], ... division="Pacific", ... conference="Western" ... ) >>> repr(team) "TeamScore(abbrev='EDM', total=500, players=1)"
- Return type:
- __init__(abbrev, name, total, players, division, conference)
Team
NHL team information.
Fields:
id- Team IDabbrev- Team abbreviation (e.g., ‘TOR’, ‘MTL’)name- Full team namedivision- Division nameconference- Conference namelogo- URL to team logo
TeamScore
- class nhl_scrabble.models.team.TeamScore(abbrev, name, total, players, division, conference)[source]
Bases:
objectRepresents a team with aggregated Scrabble score information.
- abbrev
Team abbreviation (e.g., ‘TOR’, ‘MTL’)
- name
Team full name (e.g., ‘Maple Leafs’, ‘Canadiens’)
- total
Total Scrabble score for all players on the team
- players
List of all players on the team with their scores
- division
Division name
- conference
Conference name
- avg_per_player
Average score per player (computed)
- players: list[PlayerScore]
- __post_init__()[source]
Calculate average score per player after initialization.
Examples
Automatic calculation of average:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=70, ... players=[player, player], ... division="Pacific", ... conference="Western" ... ) >>> team.avg_per_player 35.0
- Return type:
- to_dict(include_players=True)[source]
Convert to dictionary for JSON serialization.
- Parameters:
include_players (
bool) – Whether to include full player list (default: True)- Return type:
- Returns:
Dictionary representation of team
Examples
Convert team to dictionary (with players):
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=35, ... players=[player], ... division="Pacific", ... conference="Western" ... ) >>> result = team.to_dict() >>> result['abbrev'] 'EDM' >>> 'players' in result True
Convert without players:
>>> result = team.to_dict(include_players=False) >>> 'players' in result False >>> result['player_count'] 1
- property player_count: int
Return the number of players on the team.
Examples
Get player count:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=70, ... players=[player, player], ... division="Pacific", ... conference="Western" ... ) >>> team.player_count 2
- __repr__()[source]
Return a string representation of the team.
Examples
String representation:
>>> player = PlayerScore( ... first_name="Connor", ... last_name="McDavid", ... full_name="Connor McDavid", ... first_score=20, ... last_score=15, ... full_score=35, ... team="EDM", ... division="Pacific", ... conference="Western" ... ) >>> team = TeamScore( ... abbrev="EDM", ... name="Oilers", ... total=500, ... players=[player], ... division="Pacific", ... conference="Western" ... ) >>> repr(team) "TeamScore(abbrev='EDM', total=500, players=1)"
- Return type:
- __init__(abbrev, name, total, players, division, conference)
Team with aggregated player scores.
Fields:
team- Team objectplayer_scores- List of PlayerScore objectstotal- Total team scoreavg_per_player- Average score per playerplayer_count- Number of players
Example:
from nhl_scrabble.processors import TeamProcessor
processor = TeamProcessor()
team_scores = processor.process_teams(teams, all_players)
for team_score in team_scores:
print(f"{team_score.team.name}: {team_score.total} points")
Standings Models
Standings data models.
- class nhl_scrabble.models.standings.DivisionStandings(name, total, teams, player_count, avg_per_team)[source]
Bases:
objectRepresents division-level standings based on Scrabble scores.
- name
Division name
- total
Total Scrabble score for all teams in the division
- teams
List of team abbreviations in this division
- player_count
Total number of players in the division
- avg_per_team
Average score per team
- to_dict()[source]
Convert to dictionary for JSON serialization.
Examples
>>> standings = DivisionStandings( ... name="Atlantic", ... total=5000, ... teams=["TOR", "MTL", "BOS"], ... player_count=75, ... avg_per_team=1666.67 ... ) >>> result = standings.to_dict() >>> result['name'] 'Atlantic' >>> len(result['teams']) 3
- __repr__()[source]
Return a string representation of the division standings.
Examples
>>> standings = DivisionStandings( ... name="Atlantic", ... total=5000, ... teams=["TOR", "MTL", "BOS"], ... player_count=75, ... avg_per_team=1666.67 ... ) >>> repr(standings) "DivisionStandings(name='Atlantic', total=5000, teams=3)"
- Return type:
- __init__(name, total, teams, player_count, avg_per_team)
- class nhl_scrabble.models.standings.ConferenceStandings(name, total, teams, player_count, avg_per_team)[source]
Bases:
objectRepresents conference-level standings based on Scrabble scores.
- name
Conference name
- total
Total Scrabble score for all teams in the conference
- teams
List of team abbreviations in this conference
- player_count
Total number of players in the conference
- avg_per_team
Average score per team
- to_dict()[source]
Convert to dictionary for JSON serialization.
Examples
>>> standings = ConferenceStandings( ... name="Eastern", ... total=10000, ... teams=["TOR", "MTL", "BOS", "NYR"], ... player_count=100, ... avg_per_team=2500.0 ... ) >>> result = standings.to_dict() >>> result['name'] 'Eastern' >>> len(result['teams']) 4
- __repr__()[source]
Return a string representation of the conference standings.
Examples
>>> standings = ConferenceStandings( ... name="Eastern", ... total=10000, ... teams=["TOR", "MTL", "BOS", "NYR"], ... player_count=100, ... avg_per_team=2500.0 ... ) >>> repr(standings) "ConferenceStandings(name='Eastern', total=10000, teams=4)"
- Return type:
- __init__(name, total, teams, player_count, avg_per_team)
- class nhl_scrabble.models.standings.PlayoffTeam(abbrev, total, players, avg, conference, division, seed_type='', in_playoffs=False, division_rank=0, status_indicator='')[source]
Bases:
objectRepresents a team in playoff standings context.
- abbrev
Team abbreviation
- total
Total Scrabble score
- players
Number of players on the team
- avg
Average score per player
- conference
Conference name
- division
Division name
- seed_type
Playoff seed description (e.g., “Atlantic #1”, “Eastern WC1”)
- in_playoffs
Whether team has clinched a playoff spot
- division_rank
Rank within the division (1-based)
- status_indicator
Playoff status (p=Presidents’, z=Conference, y=Division, x=Playoff, e=Eliminated)
- to_dict()[source]
Convert to dictionary for JSON serialization.
Examples
>>> team = PlayoffTeam( ... abbrev="TOR", ... total=500, ... players=25, ... avg=20.0, ... conference="Eastern", ... division="Atlantic", ... seed_type="Atlantic #1", ... in_playoffs=True, ... division_rank=1, ... status_indicator="y" ... ) >>> result = team.to_dict() >>> result['abbrev'] 'TOR' >>> result['in_playoffs'] True
- __repr__()[source]
Return a string representation of the playoff team.
Examples
>>> team = PlayoffTeam( ... abbrev="TOR", ... total=500, ... players=25, ... avg=20.0, ... conference="Eastern", ... division="Atlantic", ... seed_type="Atlantic #1", ... in_playoffs=True, ... division_rank=1, ... status_indicator="y" ... ) >>> repr(team) "PlayoffTeam(abbrev='TOR', seed='Atlantic #1', status='y')"
- Return type:
- __init__(abbrev, total, players, avg, conference, division, seed_type='', in_playoffs=False, division_rank=0, status_indicator='')
DivisionStandings
- class nhl_scrabble.models.standings.DivisionStandings(name, total, teams, player_count, avg_per_team)[source]
Bases:
objectRepresents division-level standings based on Scrabble scores.
- name
Division name
- total
Total Scrabble score for all teams in the division
- teams
List of team abbreviations in this division
- player_count
Total number of players in the division
- avg_per_team
Average score per team
- to_dict()[source]
Convert to dictionary for JSON serialization.
Examples
>>> standings = DivisionStandings( ... name="Atlantic", ... total=5000, ... teams=["TOR", "MTL", "BOS"], ... player_count=75, ... avg_per_team=1666.67 ... ) >>> result = standings.to_dict() >>> result['name'] 'Atlantic' >>> len(result['teams']) 3
- __repr__()[source]
Return a string representation of the division standings.
Examples
>>> standings = DivisionStandings( ... name="Atlantic", ... total=5000, ... teams=["TOR", "MTL", "BOS"], ... player_count=75, ... avg_per_team=1666.67 ... ) >>> repr(standings) "DivisionStandings(name='Atlantic', total=5000, teams=3)"
- Return type:
- __init__(name, total, teams, player_count, avg_per_team)
Division standings with team rankings.
Fields:
name- Division nameteams- List of TeamScore objectstotal- Total division scoreplayer_count- Total players in divisionavg_per_team- Average score per team
ConferenceStandings
- class nhl_scrabble.models.standings.ConferenceStandings(name, total, teams, player_count, avg_per_team)[source]
Bases:
objectRepresents conference-level standings based on Scrabble scores.
- name
Conference name
- total
Total Scrabble score for all teams in the conference
- teams
List of team abbreviations in this conference
- player_count
Total number of players in the conference
- avg_per_team
Average score per team
- to_dict()[source]
Convert to dictionary for JSON serialization.
Examples
>>> standings = ConferenceStandings( ... name="Eastern", ... total=10000, ... teams=["TOR", "MTL", "BOS", "NYR"], ... player_count=100, ... avg_per_team=2500.0 ... ) >>> result = standings.to_dict() >>> result['name'] 'Eastern' >>> len(result['teams']) 4
- __repr__()[source]
Return a string representation of the conference standings.
Examples
>>> standings = ConferenceStandings( ... name="Eastern", ... total=10000, ... teams=["TOR", "MTL", "BOS", "NYR"], ... player_count=100, ... avg_per_team=2500.0 ... ) >>> repr(standings) "ConferenceStandings(name='Eastern', total=10000, teams=4)"
- Return type:
- __init__(name, total, teams, player_count, avg_per_team)
Conference standings with team rankings.
Fields:
name- Conference nameteams- List of TeamScore objectstotal- Total conference scoreplayer_count- Total players in conferenceavg_per_team- Average score per team