diff --git a/espn_api/basketball/constant.py b/espn_api/basketball/constant.py index 04c2b2b1..e5c8c823 100644 --- a/espn_api/basketball/constant.py +++ b/espn_api/basketball/constant.py @@ -30,7 +30,7 @@ 'UT': 11, 'BE': 12, 'IR': 13, - 'Rookie': 15 + 'Rookie': 15, } PRO_TEAM_MAP = { @@ -75,53 +75,53 @@ '4': 'OREB', '5': 'DREB', '6': 'REB', - '7': '7', - '8': '8', + '7': 'EJ', + '8': 'FF', '9': 'PF', - '10': '10', + '10': 'TF', '11': 'TO', - '12': '12', + '12': 'DQ', '13': 'FGM', '14': 'FGA', '15': 'FTM', '16': 'FTA', - '17': '3PTM', - '18': '3PTA', + '17': '3PM', + '18': '3PA', '19': 'FG%', '20': 'FT%', '21': '3PT%', - '22': '22', - '23': '23', - '24': '24', - '25': '25', - '26': '26', - '27': '27', + '22': 'AFG%', + '23': 'FGMI', + '24': 'FTMI', + '25': '3PMI', + '26': 'APG', + '27': 'BPG', '28': 'MPG', - '29': '29', - '30': '30', - '31': '31', - '32': '32', - '33': '33', - '34': '34', - '35': '35', - '36': '36', - '37': '37', - '38': '38', - '39': '39', + '29': 'PPG', + '30': 'RPG', + '31': 'SPG', + '32': 'TOPG', + '33': '3PG', + '34': 'PPM', + '35': 'A/TO', + '36': 'STR', + '37': 'DD', + '38': 'TD', + '39': 'QD', '40': 'MIN', '41': 'GS', '42': 'GP', - '43': '43', - '44': '44', + '43': 'TW', + '44': 'FTR', '45': '45', - } +} STAT_ID_MAP = { '00': 'total', '10': 'projected', '01': 'last_7', '02': 'last_15', - '03': 'last_30' + '03': 'last_30', } ACTIVITY_MAP = { @@ -133,11 +133,11 @@ 244: 'TRADED', 'FA': 178, 'WAIVER': 180, - 'TRADED': 244 + 'TRADED': 244, } NINE_CAT_STATS = { - '3PTM', + '3PM', 'AST', 'BLK', 'FG%', @@ -145,5 +145,5 @@ 'PTS', 'REB', 'STL', - 'TO' + 'TO', } diff --git a/espn_api/wbasketball/constant.py b/espn_api/wbasketball/constant.py index 3dab95a1..7fb301a4 100644 --- a/espn_api/wbasketball/constant.py +++ b/espn_api/wbasketball/constant.py @@ -16,7 +16,7 @@ 'F/C': 4, 'UTIL': 5, 'BE': 6, - 'IR': 7 + 'IR': 7, } PRO_TEAM_MAP = { @@ -43,52 +43,52 @@ '4': 'OREB', '5': 'DREB', '6': 'REB', - '7': '', - '8': '', + '7': 'EJ', + '8': 'FF', '9': 'PF', - '10': '', + '10': 'TF', '11': 'TO', - '12': '', + '12': 'DQ', '13': 'FGM', '14': 'FGA', '15': 'FTM', '16': 'FTA', - '17': '3PTM', - '18': '3PTA', + '17': '3PM', + '18': '3PA', '19': 'FG%', '20': 'FT%', '21': '3PT%', - '22': '', - '23': '', - '24': '', - '25': '', - '26': '', - '27': '', + '22': 'AFG%', + '23': 'FGMI', + '24': 'FTMI', + '25': '3PMI', + '26': 'APG', + '27': 'BPG', '28': 'MPG', - '29': '', - '30': '', - '31': '', - '32': '', - '33': '', - '34': '', - '35': '', - '36': '', - '37': '', - '38': '', - '39': '', + '29': 'PPG', + '30': 'RPG', + '31': 'SPG', + '32': 'TOPG', + '33': '3PG', + '34': 'PPM', + '35': 'A/TO', + '36': 'STR', + '37': 'DD', + '38': 'TD', + '39': 'QD', '40': 'MIN', '41': 'GS', '42': 'GP', - '43': '', - '44': '', - '45': '', - } + '43': 'TW', + '44': 'FTR', + '45': '45', +} STAT_ID_MAP = { '10': 'projected', '01': 'last_7', '02': 'last_15', - '03': 'last_30' + '03': 'last_30', } ACTIVITY_MAP = { @@ -100,5 +100,5 @@ 244: 'TRADED', 'FA': 178, 'WAIVER': 180, - 'TRADED': 244 + 'TRADED': 244, } diff --git a/tests/basketball/integration/test_league.py b/tests/basketball/integration/test_league.py index 538ed5df..a2f79cc3 100644 --- a/tests/basketball/integration/test_league.py +++ b/tests/basketball/integration/test_league.py @@ -1,13 +1,13 @@ from unittest import TestCase from espn_api.basketball import League + # Integration test to make sure ESPN's API didn't change class LeagueTest(TestCase): def setUp(self): self.league = League(411647, 2019) def test_league_init(self): - self.assertEqual(self.league.scoringPeriodId, 178) player = self.league.teams[0].roster[0] self.assertEqual(player.schedule['2']['team'], 'BKN') @@ -32,6 +32,7 @@ def test_league_free_agents(self): free_agents = self.league.free_agents() self.assertNotEqual(len(free_agents), 0) + def test_player_info(self): player_id = self.league.teams[0].roster[0].playerId @@ -49,10 +50,10 @@ def test_player_info(self): 'AST': 1.4, 'REB': 15.6, 'TO': 2.2, - '3PTM': 0.1, + '3PM': 0.1, 'FG%': 0.533, - 'FT%': 0.59 - } + 'FT%': 0.59, + }, ) def test_league_box_scores(self):