Skip to main content

suggest

suggest(
value: Any,
league: str,
n: int = 5,
) -> list[tuple[str, str]]

Up to n (team_id, name) candidates for a value that did not resolve, best first.

It never picks one for you: similar names can be different teams ("Bethany (KS)" and "Bethany (WV)").

Arguments​

NameTypeDescription
valueAnyThe team value that failed to resolve.
leaguestrThe SDV league key, e.g. "nfl".
nintThe most candidates to return.

Returns​

list[tuple[str, str]] — (team_id, name) pairs, best match first; empty when nothing is close.

Raises​

  • ValueError: If league is unknown.

Example​

import sdvplot

sdvplot.suggest("Kansas Cty Chiefs", "nfl", n=2) # [('12', 'Kansas City Chiefs')]

See also​