supercontest.util.types

Collection of custom types, classes, aliases, and generics used by other modules.

Module Attributes

PickCounts

Pick counts.

PickCountsByUser

Pick counts, by user.

PickCountsByUserByWeek

Pick counts, by user, by week.

PickCountsByUserByWeekBySeason

Pick counts, by user, by week, by season.

PickCountsByWeek

Pick counts, by week.

PickCountsByWeekByUser

Pick counts, by week, by user.

PickCountsBySeason

Pick counts, by season.

PickCountsBySeasonByUser

Pick counts, by season, by user.

PointRollups

Point rollups.

PointRollupsByUser

Point rollups, by user.

PointRollupsByUserByWeek

Point rollups, by user, by week.

PointRollupsByUserByWeekBySeason

Point rollups, by user, by week, by season.

PointRollupsByWeek

Point rollups, by week.

PointRollupsByWeekByUser

Point rollups, by week, by user.

PointRollupsBySeason

Point rollups, by season.

PointRollupsBySeasonByUser

Point rollups, by season, by user.

RawPicksByUser

Picks, by user.

RawPicksByUserByWeek

Picks, by user, by week.

RawPicksByUserByWeekBySeason

Picks, by user, by week, by season.

Functions

ddict2dict

Converts a defaultdict to a dict.

Classes

AlltimeResults

Typing for single-row (user) results of an ALLTIME-scoped view.

LinesFetch

Keys and their types for the fetched lines dictionary.

ScoresFetch

Keys and their types for the fetched scores dictionary.

SeasonResults

Typing for single-row (user) results of a SEASON-scoped view.

WeekResults

Typing for single-row (user) results of a WEEK-scoped view.

class supercontest.util.types.AlltimeResults

Bases: TypedDict

Typing for single-row (user) results of an ALLTIME-scoped view.

avg_pick_margin: NotRequired[int | float]
cover: int
noncover: int
num_picks: int
percentage: int | float
pick_counts_by_season: dict[int, dict[str, int]]
point_rollups_by_season: dict[int, dict[str, float]]
points: int | float
push: int
rank: NotRequired[int]
user_id: int
class supercontest.util.types.LinesFetch

Bases: TypedDict

Keys and their types for the fetched lines dictionary.

datetime: str
favored_team: str
home_team: str | None
line: str
underdog_team: str
supercontest.util.types.PickCounts

Pick counts.

alias of defaultdict[str, int]

supercontest.util.types.PickCountsBySeason

Pick counts, by season.

alias of dict[int, dict[str, int]]

supercontest.util.types.PickCountsBySeasonByUser

Pick counts, by season, by user.

alias of defaultdict[int, dict[int, dict[str, int]]]

supercontest.util.types.PickCountsByUser

Pick counts, by user.

alias of defaultdict[int, defaultdict[str, int]]

supercontest.util.types.PickCountsByUserByWeek

Pick counts, by user, by week.

alias of defaultdict[int, defaultdict[int, defaultdict[str, int]]]

supercontest.util.types.PickCountsByUserByWeekBySeason

Pick counts, by user, by week, by season.

alias of defaultdict[int, defaultdict[int, defaultdict[int, defaultdict[str, int]]]]

supercontest.util.types.PickCountsByWeek

Pick counts, by week.

alias of dict[int, defaultdict[str, int]]

supercontest.util.types.PickCountsByWeekByUser

Pick counts, by week, by user.

alias of defaultdict[int, dict[int, defaultdict[str, int]]]

supercontest.util.types.PointRollups

Point rollups.

alias of defaultdict[str, float]

supercontest.util.types.PointRollupsBySeason

Point rollups, by season.

alias of dict[int, dict[str, float]]

supercontest.util.types.PointRollupsBySeasonByUser

Point rollups, by season, by user.

alias of defaultdict[int, dict[int, dict[str, float]]]

supercontest.util.types.PointRollupsByUser

Point rollups, by user.

alias of defaultdict[int, defaultdict[str, float]]

supercontest.util.types.PointRollupsByUserByWeek

Point rollups, by user, by week.

alias of defaultdict[int, defaultdict[int, defaultdict[str, float]]]

supercontest.util.types.PointRollupsByUserByWeekBySeason

Point rollups, by user, by week, by season.

alias of defaultdict[int, defaultdict[int, defaultdict[int, defaultdict[str, float]]]]

supercontest.util.types.PointRollupsByWeek

Point rollups, by week.

alias of dict[int, defaultdict[str, float]]

supercontest.util.types.PointRollupsByWeekByUser

Point rollups, by week, by user.

alias of defaultdict[int, dict[int, defaultdict[str, float]]]

supercontest.util.types.RawPicksByUser

Picks, by user.

alias of defaultdict[int, list[Any]]

supercontest.util.types.RawPicksByUserByWeek

Picks, by user, by week.

alias of defaultdict[int, defaultdict[int, list[Any]]]

supercontest.util.types.RawPicksByUserByWeekBySeason

Picks, by user, by week, by season.

alias of defaultdict[int, defaultdict[int, defaultdict[int, list[Any]]]]

class supercontest.util.types.ScoresFetch

Bases: TypedDict

Keys and their types for the fetched scores dictionary.

status: str
team_scores: dict[str, int]
class supercontest.util.types.SeasonResults

Bases: TypedDict

Typing for single-row (user) results of a SEASON-scoped view.

bonus: NotRequired[int]
cover: int
noncover: int
num_picks: int
payout: NotRequired[int]
percentage: int | float
percentile: NotRequired[int | float]
pick_counts_by_week: dict[int, defaultdict[str, int]]
point_rollups_by_week: dict[int, defaultdict[str, float]]
points: int | float
purse: NotRequired[int]
push: int
rank: NotRequired[int]
user_id: int
class supercontest.util.types.WeekResults

Bases: TypedDict

Typing for single-row (user) results of a WEEK-scoped view.

grade: NotRequired[float]
num_picks: int
pick_counts: defaultdict[str, int]
points_finished: float
points_inprogress: float
rank: NotRequired[int]
sorted_pick_teams: list[str]
user_id: int
supercontest.util.types.ddict2dict(ddict: defaultdict[Any, Any] | dict[Any, Any]) dict[Any, Any]

Converts a defaultdict to a dict. Handles nested/recursion.

Parameters:

ddict – Default dictionary.

Returns:

Dictionary.