Skip to main content
Version: main

marks

marks(
team: Any,
league: str,
*,
season: Any = None,
id_system: Literal['auto', 'team_id', 'espn', 'espn_abbr', 'nhl', 'nflverse', 'mlbstats', 'nba_api', 'hockeytech', 'ncaa', 'pff', 'cricinfo', 'cfbd', 'bref', 'sportsipy', 'fangraphs', 'yahoo', 'kenpom', 'torvik', 'sdvplotr', 'name', 'nhl_id', 'fox', 'cbs', 'sports247', 'on3'] = 'auto',
) -> polars.dataframe.frame.DataFrame

Every archived mark for one team, best first.

Manifest entity ids are per-source, so rows reach a team only through its "mark" aliases; rows without a unique mapping are dropped, never matched on the raw id. valid_from/valid_to are each row's effective range: the manifest's, narrowed by the mark alias's (an open side takes the alias's).

Arguments​

NameTypeDescription
teamAnyOne team identifier (abbreviation, name, ESPN id, ...), or a conference or league row's key ("SEC", "AFC": the team_id of teams(league, include_conferences=True)).
leaguestrThe SDV league key, e.g. "nfl".
seasonAnyA season year, used to resolve a reused code.
id_systemLiteral['auto', 'team_id', 'espn', 'espn_abbr', 'nhl', 'nflverse', 'mlbstats', 'nba_api', 'hockeytech', 'ncaa', 'pff', 'cricinfo', 'cfbd', 'bref', 'sportsipy', 'fangraphs', 'yahoo', 'kenpom', 'torvik', 'sdvplotr', 'name', 'nhl_id', 'fox', 'cbs', 'sports247', 'on3']"auto" or one id-system name, as in resolve.

Returns​

polars.DataFrame — One row per archived mark (logos and wordmarks, every variant and source) with its variant, mark_type, archive_url and source_rank.

Raises​

  • TypeError: If team is not a single value.
  • InputError: (a ValueError) If league or id_system is unknown, or season is not a year or is outside the seasons sdvplot knows for the league.
  • UnresolvedTeamError: (a ValueError) If the team is null or does not resolve.
  • OfflineError: If the logo manifest cannot be downloaded and no cached copy exists (a DownloadError, also an OSError, when the CDN answers with an error status).
  • UnsafeDownloadError: (an OSError) If the manifest download is refused: larger than the byte cap, past the deadline, or redirected away from https.

Example​

import sdvplot

sdvplot.marks("KC", "nfl").shape # (19, 21)

See also​