Package: py-nba-stats
This is a package to get NBA stats from scraping yahoo.comThere are 2 main classes in this packageDataAttributePlayerTeamDataAttributethis is the return value from most of the Player methodsAttributes:names: list = field(default_factory=list)num_game: int = 1fg_made: float = 0.0fg_attempt: float = 0.0three_made: float = 0.0three_attempt: float = 0.0ft_made: float = 0.0ft_attempt: float = 0.0rebound: float = 0.0assist: float = 0.0turnover: float = 0.0steal: float = 0.0block: float = 0.0point: float = 0.0PlayerAttributes:name (string):                              player's full nameplayer_id (int):                            player 4 digit idgame_raw_data (BeautifulSoup object):       internal data for processingyearly_raw_data (BeautifulSoup object):     internal data for processingteam (string):                              player's teamnumber (int):                               player's numberavg_pt (float):                             average point for current seasonavg_reb (float):                            average rebound for current seasonavg_ast (float):                            average assist for current seasonposition (string):                          positioncollege (string):                           college the player attendedMethods:get_yearly_data(self, year='current')return the yearly average represented by DataAttribute dataclassrequired parameters:year (int): a 4 digit formatted year, eg, 2019. If it's "current", it'll get the current yearget_recent_games_data(self, game_type='all', home_only=False, away_only=False, games=5, year='current')return a list of DataAttribute objectsrequired parameters:game_type (string): accepted types are all, reg, or post, default=allhome_only (bool):   home game only, default=Falseaway_only (bool):   away game only, default=Falsegames (int):        the number of games, default=5year (int):         a 4 digit formatted year, eg, 2019. If it's "current", it'll get the current year. default=currentget_recent_games_avg_stats(self, game_type='all', home_only=False, away_only=False, games=5, year='current')return a list of DataAttribute objectsrequired parameters:game_type (string): accepted types are all, reg, or post, default=allhome_only (bool):   home game only, default=Falseaway_only (bool):   away game only, default=Falsegames (int):        the number of games, default=5year (int):         a 4 digit formatted year, eg, 2019. If it's "current", it'll get the current year. default=currentget_data_by_opponentt(self, oppo, game_type='all', year='current')return a list of DataAttribute objectsrequired parameters:game_type (string): accepted types are all, reg, or post, default=allhome_only (bool):   home game only, default=Falseaway_only (bool):   away game only, default=Falsegames (int):        the number of games, default=5year (int):         a 4 digit formatted year, eg, 2019. If it's "current", it'll get the current year. default=currentget_avg_stats_by_opponent(self, oppo, game_type='all', year='current')return the average stats against a particular opponent represented by DataAttribute dataclassrequired parameters:oppo (string):      the 3 charater team name, eg, "BKN"game_type (string): accepted types are all, reg, or post, default=allyear (int):         a 4 digit formatted year, eg, 2019. If it's "current", it'll get the current year. default=currentclear_cache(self)clear cachesrequred parameters:NoneTeamAttributes:name (string):                      team namewin (int):                          number of wins for current seasonloss (int):                         number of loss for current seasonpt (float):                         average pointreb (float):                        average reboundfg (float):                         average fild goal percentagepercent_3pt (float):                average 3 point percentagestanding (string):                  team standingraw_data (BeautifulSoup object):    internal data for processingplayers (list[Player]):             list of player objectsExamplefrom nba_stats import nba_stats
player = nba_stats.Player('Stephen Curry')
player.get_yearly_data()
DataAttribute(names=['2020-21'], num_game='4', fg_made=8.3, fg_attempt=20.0, three_made=3.5, three_attempt=11.0, ft_made=6.5, ft_attempt=6.5, rebound=3.8, assist=7.0, turnover=4.3, steal=1.8, block=0.5, point=26.5)
player.get_avg_stats_by_opponent('CLE', year=2019)
DataAttribute(names=['@CLE'], num_game=1, fg_made=6.0, fg_attempt=14.0, three_made=1.0, three_attempt=3.0, ft_made=1.0, ft_attempt=2.0, rebound=6.0, assist=5.0, turnover=2.0, steal=0.0, block=0.0, point=14.0)

team = nba_stats.Team('Golden State Warriors')
team.pt
111.0
team.win
2