Image - basketballrelativity/py_ball GitHub Wiki
This section details all the images accessible via the Headshot
and Logo
classes in image.py. Classes available include:
Class | Description | Leagues |
---|---|---|
Headshot | Headshot images of players | NBA, WNBA, G-League |
Logo | Logo images | NBA*, WNBA, G-League |
*NBA logos are available historically
Parameters
The classes require the corresponding parameters below:
Class Param | Definition | Valid Values | Required |
---|---|---|---|
league | String, either 'WNBA', 'G', or 'NBA' to the league in which the desired player or team plays | 'NBA', 'WNBA', 'G' | Headshot, Logo |
player_id | String of an integer corresponding to a player ID for a given player. Valid only for NBA/WNBA headshots | Headshot | |
team_id | String of a 10-digit integer that uniquely identifies a team for which data is to be returned. Valid only for NBA headshots and NBA/WNBA logos | Headshot, Logo | |
season | String of a year in YYYY format corresponding to the year in which the NBA season begins. Valid only for NBA headshots | 'YYYY' | Headshot |
season_year | String of a two-year season year in a YYYY-ZZ format, where the ZZ are the last two digits of the following year. For example, '2017-18' is a valid value of season_year and represents the 2017-18 NBA season. season_year is only required for NBA logos | YYYY-ZZ | Logo |
Features
Each class contains a self.image
object, a PNG of the desired image in memory.