Skip to content

League Class Basketball

Christian Wendt edited this page Sep 16, 2020 · 9 revisions

Documentation of all Variables and usable functions for League Class

League

The League Object is used for getting all of your ESPN Fantasy data including teams, roster, players, scoreboards.

Usage

Set debug parameter to True if you want to see all of the ESPN API requests and responses print to the console

from espn_api.basketball import League
league = League(league_id: int, year: int, espn_s2: str = None, swid: str = None, username: str = None, password: str = None, debug=False)

Links

Team Class

Variables

league_id: int
year: int
teams: List[Team]

Functions

Returns basic information on a match up for a current week. This can be used for previous years
Check out Matchup Class!

def scoreboard(week: int = None) -> List[Matchup]

Returns a list of Activities

# msg_type inputs: 'FA', 'WAVIER', 'TRADED'
def recent_activity(size: int = 25, msg_type: str = None) -> List[Activity]:

Helper functions

def standings() -> List[Team]:
def get_team_data(team_id: int) -> Team: