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: object

Represents 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

name: str
total: int
teams: list[str]
player_count: int
avg_per_team: float
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
Return type:

dict[str, Any]

__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:

str

__init__(name, total, teams, player_count, avg_per_team)
class nhl_scrabble.models.DivisionStandings(name, total, teams, player_count, avg_per_team)[source]

Bases: object

Represents 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

name: str
total: int
teams: list[str]
player_count: int
avg_per_team: float
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
Return type:

dict[str, Any]

__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:

str

__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: object

Represents 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

first_name: str
last_name: str
full_name: str
first_score: int
last_score: int
full_score: int
team: str
division: str
conference: str
to_dict()[source]

Convert to dictionary for JSON serialization.

Return type:

dict[str, Any]

Returns:

Dictionary representation of player

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:

str

__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: object

Represents 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)

abbrev: str
total: int
players: int
avg: float
conference: str
division: str
seed_type: str
in_playoffs: bool
division_rank: int
status_indicator: Literal['p', 'z', 'y', 'x', 'e', '']
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
Return type:

dict[str, Any]

__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:

str

__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: object

Represents 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)

abbrev: str
name: str
total: int
players: list[PlayerScore]
division: str
conference: str
avg_per_player: float
__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:

None

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:

dict[str, Any]

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:

str

__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: object

Represents 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

first_name: str
last_name: str
full_name: str
first_score: int
last_score: int
full_score: int
team: str
division: str
conference: str
to_dict()[source]

Convert to dictionary for JSON serialization.

Return type:

dict[str, Any]

Returns:

Dictionary representation of player

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:

str

__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 ID

  • firstName - Player’s first name

  • lastName - Player’s last name

  • sweaterNumber - 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: object

Represents 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

first_name: str
last_name: str
full_name: str
first_score: int
last_score: int
full_score: int
team: str
division: str
conference: str
to_dict()[source]

Convert to dictionary for JSON serialization.

Return type:

dict[str, Any]

Returns:

Dictionary representation of player

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:

str

__init__(first_name, last_name, full_name, first_score, last_score, full_score, team, division, conference)

Player with calculated Scrabble score.

Fields:

  • player - Player object

  • first_score - Score for first name

  • last_score - Score for last name

  • total - 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: object

Represents 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)

abbrev: str
name: str
total: int
players: list[PlayerScore]
division: str
conference: str
avg_per_player: float
__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:

None

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:

dict[str, Any]

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:

str

__init__(abbrev, name, total, players, division, conference)

Team

NHL team information.

Fields:

  • id - Team ID

  • abbrev - Team abbreviation (e.g., ‘TOR’, ‘MTL’)

  • name - Full team name

  • division - Division name

  • conference - Conference name

  • logo - URL to team logo

TeamScore

class nhl_scrabble.models.team.TeamScore(abbrev, name, total, players, division, conference)[source]

Bases: object

Represents 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)

abbrev: str
name: str
total: int
players: list[PlayerScore]
division: str
conference: str
avg_per_player: float
__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:

None

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:

dict[str, Any]

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:

str

__init__(abbrev, name, total, players, division, conference)

Team with aggregated player scores.

Fields:

  • team - Team object

  • player_scores - List of PlayerScore objects

  • total - Total team score

  • avg_per_player - Average score per player

  • player_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: object

Represents 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

name: str
total: int
teams: list[str]
player_count: int
avg_per_team: float
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
Return type:

dict[str, Any]

__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:

str

__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: object

Represents 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

name: str
total: int
teams: list[str]
player_count: int
avg_per_team: float
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
Return type:

dict[str, Any]

__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:

str

__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: object

Represents 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)

abbrev: str
total: int
players: int
avg: float
conference: str
division: str
seed_type: str
in_playoffs: bool
division_rank: int
status_indicator: Literal['p', 'z', 'y', 'x', 'e', '']
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
Return type:

dict[str, Any]

__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:

str

__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: object

Represents 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

name: str
total: int
teams: list[str]
player_count: int
avg_per_team: float
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
Return type:

dict[str, Any]

__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:

str

__init__(name, total, teams, player_count, avg_per_team)

Division standings with team rankings.

Fields:

  • name - Division name

  • teams - List of TeamScore objects

  • total - Total division score

  • player_count - Total players in division

  • avg_per_team - Average score per team

ConferenceStandings

class nhl_scrabble.models.standings.ConferenceStandings(name, total, teams, player_count, avg_per_team)[source]

Bases: object

Represents 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

name: str
total: int
teams: list[str]
player_count: int
avg_per_team: float
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
Return type:

dict[str, Any]

__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:

str

__init__(name, total, teams, player_count, avg_per_team)

Conference standings with team rankings.

Fields:

  • name - Conference name

  • teams - List of TeamScore objects

  • total - Total conference score

  • player_count - Total players in conference

  • avg_per_team - Average score per team