Ejemplo n.º 1
0
 def get_player_bio(self, info, id):
     url = "http://stats.nba.com/stats/commonplayerinfo?"
     api_params = {'PlayerID' : id,'LeagueID' : '00'}
     x = rq.get(url, params=api_params).json()
     headers = x['resultSets'][0]['headers']
     results = x['resultSets'][0]['rowSet']
     info.set_birthday(results[0][headers.index('BIRTHDATE')])
     info.set_school(results[0][headers.index('SCHOOL')])
     info.set_height(results[0][headers.index('HEIGHT')])
     info.set_weight(results[0][headers.index('WEIGHT')])
     info.set_years_pro(results[0][headers.index('SEASON_EXP')])
     info.set_team(results[0][headers.index('TEAM_NAME')])