squad
squad
¶
Squad and FullSquad domain objects.
Squad
dataclass
¶
Squad(
players: list[Player],
formation: str,
total_cost: float,
expected_points: float,
captain: Optional[Player] = None,
)
Represents an 11-player starting lineup.
| ATTRIBUTE | DESCRIPTION |
|---|---|
players |
Selected starters (exactly 11).
TYPE:
|
formation |
Formation string (e.g., "3-4-3").
TYPE:
|
total_cost |
Total cost of the starting 11.
TYPE:
|
expected_points |
Expected total points for the starting 11.
TYPE:
|
captain |
Captain selection (earns double points).
TYPE:
|
summary
¶
Returns a formatted string summary of the lineup.
Source code in fplx/core/squad.py
FullSquad
dataclass
¶
FullSquad(
squad_players: list[Player],
lineup: Squad,
bench: list[Player] = list(),
squad_cost: float = 0.0,
expected_points: float = 0.0,
)
Represents a 15-player FPL squad with a selected 11-player lineup.
The two-level FPL structure: Level 1: 15-player squad (2 GK, 5 DEF, 5 MID, 3 FWD) under budget. Level 2: 11-player starting lineup chosen from the squad each gameweek.
| ATTRIBUTE | DESCRIPTION |
|---|---|
squad_players |
All 15 squad members.
TYPE:
|
lineup |
The 11-player starting lineup (subset of squad_players).
TYPE:
|
bench |
The 4 bench players.
TYPE:
|
squad_cost |
Total cost of all 15 players.
TYPE:
|
expected_points |
Expected points for the starting 11.
TYPE:
|
summary
¶
Returns a formatted string summary of the full squad.