diff --git a/.circleci/config.yml b/.circleci/config.yml index 5391a9d2..1c445bae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,8 @@ flake8-steps: &steps #- run: pytest - run: pip install --user pytest - run: python -m pytest tests/stats/library/playbyplay/test_play_by_play_regex.py + - run: python -m pytest tests/live/endpoints + jobs: Python34: diff --git a/docs/examples/LiveData.ipynb b/docs/examples/LiveData.ipynb new file mode 100644 index 00000000..82628952 --- /dev/null +++ b/docs/examples/LiveData.ipynb @@ -0,0 +1,2520 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Working with NBA live data...\n", + "Libraries supporting live data do not include support for Pandas. Note: Any call to `{endpoint}.{Class}()` will perform a request. Example: `scoreboard.ScoreBoard()`. In order to avoid multiple requests, set `{endpoint}.{Class}()` to a variable. See sample code below." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Today's Score Board\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ScoreBoardDate: 2021-01-18\n", + "0022000207: Spurs vs. Trail Blazers @ 2021-01-18 15:00:00-05:00\n", + "0022000205: Timberwolves vs. Hawks @ 2021-01-18 14:30:00-05:00\n", + "0022000203: Magic vs. Knicks @ 2021-01-18 12:00:00-05:00\n", + "0022000204: Cavaliers vs. Wizards @ 2021-01-18 14:00:00-05:00\n", + "0022000208: Suns vs. Grizzlies @ 2021-01-18 17:00:00-05:00\n", + "0022000209: Bucks vs. Nets @ 2021-01-18 19:30:00-05:00\n", + "0022000210: Mavericks vs. Raptors @ 2021-01-18 19:30:00-05:00\n", + "0022000206: Pistons vs. Heat @ 2021-01-18 20:00:00-05:00\n", + "0022000211: Rockets vs. Bulls @ 2021-01-18 20:00:00-05:00\n", + "0022000212: Warriors vs. Lakers @ 2021-01-18 22:00:00-05:00\n" + ] + } + ], + "source": [ + "# Query nba.live.endpoints.scoreboard and list games in localTimeZone\n", + "from datetime import datetime, timezone\n", + "from dateutil import parser\n", + "from nba_api.live.nba.endpoints import scoreboard\n", + "\n", + "f = \"{gameId}: {awayTeam} vs. {homeTeam} @ {gameTimeLTZ}\" \n", + "\n", + "board = scoreboard.ScoreBoard()\n", + "print(\"ScoreBoardDate: \" + board.score_board_date)\n", + "games = board.games.get_dict()\n", + "for game in games:\n", + " gameTimeLTZ = parser.parse(game[\"gameTimeUTC\"]).replace(tzinfo=timezone.utc).astimezone(tz=None)\n", + " print(f.format(gameId=game['gameId'], awayTeam=game['awayTeam']['teamName'], homeTeam=game['homeTeam']['teamName'], gameTimeLTZ=gameTimeLTZ))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Box Score" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# Get BoxScore\n", + "from nba_api.live.nba.endpoints import boxscore\n", + "box = boxscore.BoxScore('0022000196') " + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'gameId': '0022000196',\n", + " 'gameTimeLocal': '2021-01-17T13:00:00-05:00',\n", + " 'gameTimeUTC': '2021-01-17T18:00:00Z',\n", + " 'gameTimeHome': '2021-01-17T13:00:00-05:00',\n", + " 'gameTimeAway': '2021-01-17T13:00:00-05:00',\n", + " 'gameEt': '2021-01-17T13:00:00-05:00',\n", + " 'duration': 134,\n", + " 'gameCode': '20210117/NYKBOS',\n", + " 'gameStatusText': 'Final',\n", + " 'gameStatus': 3,\n", + " 'regulationPeriods': 4,\n", + " 'period': 4,\n", + " 'gameClock': 'PT00M00.00S',\n", + " 'attendance': 0,\n", + " 'sellout': '0',\n", + " 'arena': {'arenaId': 17,\n", + " 'arenaName': 'TD Garden',\n", + " 'arenaCity': 'Boston',\n", + " 'arenaState': 'MA',\n", + " 'arenaCountry': 'US',\n", + " 'arenaTimezone': 'America/New_York'},\n", + " 'officials': [{'personId': 2882,\n", + " 'name': 'Sean Wright',\n", + " 'nameI': 'S. Wright',\n", + " 'firstName': 'Sean',\n", + " 'familyName': 'Wright',\n", + " 'jerseyNum': '4',\n", + " 'assignment': 'OFFICIAL1'},\n", + " {'personId': 201638,\n", + " 'name': 'Brent Barnaky',\n", + " 'nameI': 'B. Barnaky',\n", + " 'firstName': 'Brent',\n", + " 'familyName': 'Barnaky',\n", + " 'jerseyNum': '36',\n", + " 'assignment': 'OFFICIAL2'},\n", + " {'personId': 1627524,\n", + " 'name': 'Nate Green',\n", + " 'nameI': 'N. Green',\n", + " 'firstName': 'Nate',\n", + " 'familyName': 'Green',\n", + " 'jerseyNum': '65',\n", + " 'assignment': 'OFFICIAL3'}],\n", + " 'homeTeam': {'teamId': 1610612738,\n", + " 'teamName': 'Celtics',\n", + " 'teamCity': 'Boston',\n", + " 'teamTricode': 'BOS',\n", + " 'score': 75,\n", + " 'inBonus': '1',\n", + " 'timeoutsRemaining': 2,\n", + " 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 17},\n", + " {'period': 2, 'periodType': 'REGULAR', 'score': 18},\n", + " {'period': 3, 'periodType': 'REGULAR', 'score': 15},\n", + " {'period': 4, 'periodType': 'REGULAR', 'score': 25}],\n", + " 'players': [{'status': 'ACTIVE',\n", + " 'order': 1,\n", + " 'personId': 1627759,\n", + " 'jerseyNum': '7',\n", + " 'position': 'SF',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 3,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 2,\n", + " 'fieldGoalsAttempted': 20,\n", + " 'fieldGoalsMade': 9,\n", + " 'fieldGoalsPercentage': 0.45,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 5,\n", + " 'foulsPersonal': 3,\n", + " 'foulsTechnical': 1,\n", + " 'freeThrowsAttempted': 5,\n", + " 'freeThrowsMade': 4,\n", + " 'freeThrowsPercentage': 0.8,\n", + " 'minus': 73.0,\n", + " 'minutes': 'PT32M33.00S',\n", + " 'minutesCalculated': 'PT33M',\n", + " 'plus': 46.0,\n", + " 'plusMinusPoints': -27.0,\n", + " 'points': 25,\n", + " 'pointsFastBreak': 7,\n", + " 'pointsInThePaint': 8,\n", + " 'pointsSecondChance': 4,\n", + " 'reboundsDefensive': 3,\n", + " 'reboundsOffensive': 3,\n", + " 'reboundsTotal': 6,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 9,\n", + " 'threePointersMade': 3,\n", + " 'threePointersPercentage': 0.333333333333333,\n", + " 'turnovers': 2,\n", + " 'twoPointersAttempted': 11,\n", + " 'twoPointersMade': 6,\n", + " 'twoPointersPercentage': 0.545454545454545},\n", + " 'name': 'Jaylen Brown',\n", + " 'nameI': 'J. Brown',\n", + " 'firstName': 'Jaylen',\n", + " 'familyName': 'Brown'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 2,\n", + " 'personId': 1629684,\n", + " 'jerseyNum': '12',\n", + " 'position': 'PF',\n", + " 'starter': '1',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 1,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 5,\n", + " 'fieldGoalsMade': 1,\n", + " 'fieldGoalsPercentage': 0.2,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 2,\n", + " 'foulsPersonal': 5,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 4,\n", + " 'freeThrowsMade': 1,\n", + " 'freeThrowsPercentage': 0.25,\n", + " 'minus': 59.0,\n", + " 'minutes': 'PT24M25.00S',\n", + " 'minutesCalculated': 'PT24M',\n", + " 'plus': 41.0,\n", + " 'plusMinusPoints': -18.0,\n", + " 'points': 3,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 2,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 1,\n", + " 'reboundsOffensive': 1,\n", + " 'reboundsTotal': 2,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 4,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 1,\n", + " 'twoPointersMade': 1,\n", + " 'twoPointersPercentage': 1.0},\n", + " 'name': 'Grant Williams',\n", + " 'nameI': 'G. Williams',\n", + " 'firstName': 'Grant',\n", + " 'familyName': 'Williams'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 3,\n", + " 'personId': 202684,\n", + " 'jerseyNum': '13',\n", + " 'position': 'C',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 1,\n", + " 'blocksReceived': 1,\n", + " 'fieldGoalsAttempted': 5,\n", + " 'fieldGoalsMade': 1,\n", + " 'fieldGoalsPercentage': 0.2,\n", + " 'foulsOffensive': 1,\n", + " 'foulsDrawn': 3,\n", + " 'foulsPersonal': 1,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 2,\n", + " 'freeThrowsMade': 1,\n", + " 'freeThrowsPercentage': 0.5,\n", + " 'minus': 54.0,\n", + " 'minutes': 'PT26M12.04S',\n", + " 'minutesCalculated': 'PT26M',\n", + " 'plus': 36.0,\n", + " 'plusMinusPoints': -18.0,\n", + " 'points': 3,\n", + " 'pointsFastBreak': 1,\n", + " 'pointsInThePaint': 2,\n", + " 'pointsSecondChance': 1,\n", + " 'reboundsDefensive': 1,\n", + " 'reboundsOffensive': 5,\n", + " 'reboundsTotal': 6,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 2,\n", + " 'twoPointersAttempted': 5,\n", + " 'twoPointersMade': 1,\n", + " 'twoPointersPercentage': 0.2},\n", + " 'name': 'Tristan Thompson',\n", + " 'nameI': 'T. Thompson',\n", + " 'firstName': 'Tristan',\n", + " 'familyName': 'Thompson'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 4,\n", + " 'personId': 203935,\n", + " 'jerseyNum': '36',\n", + " 'position': 'SG',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 2,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 1,\n", + " 'fieldGoalsAttempted': 15,\n", + " 'fieldGoalsMade': 4,\n", + " 'fieldGoalsPercentage': 0.266666666666667,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 6,\n", + " 'foulsPersonal': 3,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 5,\n", + " 'freeThrowsMade': 2,\n", + " 'freeThrowsPercentage': 0.4,\n", + " 'minus': 64.0,\n", + " 'minutes': 'PT29M22.00S',\n", + " 'minutesCalculated': 'PT29M',\n", + " 'plus': 42.0,\n", + " 'plusMinusPoints': -22.0,\n", + " 'points': 10,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 8,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 2,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 2,\n", + " 'steals': 2,\n", + " 'threePointersAttempted': 7,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 8,\n", + " 'twoPointersMade': 4,\n", + " 'twoPointersPercentage': 0.5},\n", + " 'name': 'Marcus Smart',\n", + " 'nameI': 'M. Smart',\n", + " 'firstName': 'Marcus',\n", + " 'familyName': 'Smart'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 5,\n", + " 'personId': 202689,\n", + " 'jerseyNum': '8',\n", + " 'position': 'PG',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 4,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 13,\n", + " 'fieldGoalsMade': 3,\n", + " 'fieldGoalsPercentage': 0.230769230769231,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 4,\n", + " 'foulsPersonal': 1,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 3,\n", + " 'freeThrowsMade': 2,\n", + " 'freeThrowsPercentage': 0.666666666666666,\n", + " 'minus': 36.0,\n", + " 'minutes': 'PT19M37.00S',\n", + " 'minutesCalculated': 'PT20M',\n", + " 'plus': 27.0,\n", + " 'plusMinusPoints': -9.0,\n", + " 'points': 9,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 4,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 3,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 3,\n", + " 'steals': 3,\n", + " 'threePointersAttempted': 8,\n", + " 'threePointersMade': 1,\n", + " 'threePointersPercentage': 0.125,\n", + " 'turnovers': 5,\n", + " 'twoPointersAttempted': 5,\n", + " 'twoPointersMade': 2,\n", + " 'twoPointersPercentage': 0.4},\n", + " 'name': 'Kemba Walker',\n", + " 'nameI': 'K. Walker',\n", + " 'firstName': 'Kemba',\n", + " 'familyName': 'Walker'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 6,\n", + " 'personId': 201952,\n", + " 'jerseyNum': '55',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 2,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 1,\n", + " 'fieldGoalsAttempted': 4,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 2,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 40.0,\n", + " 'minutes': 'PT14M28.00S',\n", + " 'minutesCalculated': 'PT15M',\n", + " 'plus': 25.0,\n", + " 'plusMinusPoints': -15.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 2,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 2,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 2,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 2,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Jeff Teague',\n", + " 'nameI': 'J. Teague',\n", + " 'firstName': 'Jeff',\n", + " 'familyName': 'Teague'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 7,\n", + " 'personId': 1628464,\n", + " 'jerseyNum': '27',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 1,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 4,\n", + " 'fieldGoalsMade': 3,\n", + " 'fieldGoalsPercentage': 0.75,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 2,\n", + " 'foulsPersonal': 3,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 39.0,\n", + " 'minutes': 'PT19M49.00S',\n", + " 'minutesCalculated': 'PT20M',\n", + " 'plus': 32.0,\n", + " 'plusMinusPoints': -7.0,\n", + " 'points': 7,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 4,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 6,\n", + " 'reboundsOffensive': 1,\n", + " 'reboundsTotal': 7,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 2,\n", + " 'threePointersMade': 1,\n", + " 'threePointersPercentage': 0.5,\n", + " 'turnovers': 2,\n", + " 'twoPointersAttempted': 2,\n", + " 'twoPointersMade': 2,\n", + " 'twoPointersPercentage': 1.0},\n", + " 'name': 'Daniel Theis',\n", + " 'nameI': 'D. Theis',\n", + " 'firstName': 'Daniel',\n", + " 'familyName': 'Theis'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 8,\n", + " 'personId': 1628400,\n", + " 'jerseyNum': '37',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 1,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 6,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 1,\n", + " 'foulsDrawn': 3,\n", + " 'foulsPersonal': 1,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 4,\n", + " 'freeThrowsMade': 4,\n", + " 'freeThrowsPercentage': 1.0,\n", + " 'minus': 48.0,\n", + " 'minutes': 'PT23M22.00S',\n", + " 'minutesCalculated': 'PT23M',\n", + " 'plus': 39.0,\n", + " 'plusMinusPoints': -9.0,\n", + " 'points': 4,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 2,\n", + " 'reboundsOffensive': 1,\n", + " 'reboundsTotal': 3,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 6,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Semi Ojeleye',\n", + " 'nameI': 'S. Ojeleye',\n", + " 'firstName': 'Semi',\n", + " 'familyName': 'Ojeleye'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 9,\n", + " 'personId': 1630202,\n", + " 'jerseyNum': '11',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 1,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 3,\n", + " 'fieldGoalsMade': 1,\n", + " 'fieldGoalsPercentage': 0.333333333333333,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 1,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 32.0,\n", + " 'minutes': 'PT17M22.96S',\n", + " 'minutesCalculated': 'PT17M',\n", + " 'plus': 28.0,\n", + " 'plusMinusPoints': -4.0,\n", + " 'points': 3,\n", + " 'pointsFastBreak': 3,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 4,\n", + " 'reboundsOffensive': 1,\n", + " 'reboundsTotal': 5,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 3,\n", + " 'threePointersMade': 1,\n", + " 'threePointersPercentage': 0.333333333333333,\n", + " 'turnovers': 2,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Payton Pritchard',\n", + " 'nameI': 'P. Pritchard',\n", + " 'firstName': 'Payton',\n", + " 'familyName': 'Pritchard'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 10,\n", + " 'personId': 1629750,\n", + " 'jerseyNum': '43',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 3,\n", + " 'fieldGoalsMade': 2,\n", + " 'fieldGoalsPercentage': 0.666666666666666,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 3,\n", + " 'foulsPersonal': 1,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 6,\n", + " 'freeThrowsMade': 4,\n", + " 'freeThrowsPercentage': 0.666666666666666,\n", + " 'minus': 39.0,\n", + " 'minutes': 'PT17M50.00S',\n", + " 'minutesCalculated': 'PT18M',\n", + " 'plus': 29.0,\n", + " 'plusMinusPoints': -10.0,\n", + " 'points': 8,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 4,\n", + " 'pointsSecondChance': 1,\n", + " 'reboundsDefensive': 3,\n", + " 'reboundsOffensive': 2,\n", + " 'reboundsTotal': 5,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 1,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 2,\n", + " 'twoPointersMade': 2,\n", + " 'twoPointersPercentage': 1.0},\n", + " 'name': 'Javonte Green',\n", + " 'nameI': 'J. Green',\n", + " 'firstName': 'Javonte',\n", + " 'familyName': 'Green'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 11,\n", + " 'personId': 1630174,\n", + " 'jerseyNum': '26',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 2,\n", + " 'fieldGoalsAttempted': 4,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 1,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 23.0,\n", + " 'minutes': 'PT08M26.00S',\n", + " 'minutesCalculated': 'PT08M',\n", + " 'plus': 17.0,\n", + " 'plusMinusPoints': -6.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 1,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 1,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 2,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 2,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Aaron Nesmith',\n", + " 'nameI': 'A. Nesmith',\n", + " 'firstName': 'Aaron',\n", + " 'familyName': 'Nesmith'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 12,\n", + " 'personId': 1629682,\n", + " 'jerseyNum': '51',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 1,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 2,\n", + " 'fieldGoalsMade': 1,\n", + " 'fieldGoalsPercentage': 0.5,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 18.0,\n", + " 'minutes': 'PT06M33.00S',\n", + " 'minutesCalculated': 'PT07M',\n", + " 'plus': 13.0,\n", + " 'plusMinusPoints': -5.0,\n", + " 'points': 3,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 1,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 1,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 2,\n", + " 'threePointersMade': 1,\n", + " 'threePointersPercentage': 0.5,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Tremont Waters',\n", + " 'nameI': 'T. Waters',\n", + " 'firstName': 'Tremont',\n", + " 'familyName': 'Waters'},\n", + " {'status': 'INACTIVE',\n", + " 'notPlayingReason': 'INACTIVE_HEALTH_AND_SAFETY_PROTOCOLS',\n", + " 'order': 13,\n", + " 'personId': 1629035,\n", + " 'jerseyNum': '4',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Carsen Edwards',\n", + " 'nameI': 'C. Edwards',\n", + " 'firstName': 'Carsen',\n", + " 'familyName': 'Edwards'},\n", + " {'status': 'INACTIVE',\n", + " 'notPlayingReason': 'INACTIVE_INJURY',\n", + " 'notPlayingDescription': 'Left Ankle; Sprain',\n", + " 'order': 14,\n", + " 'personId': 1629605,\n", + " 'jerseyNum': '99',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Tacko Fall',\n", + " 'nameI': 'T. Fall',\n", + " 'firstName': 'Tacko',\n", + " 'familyName': 'Fall'},\n", + " {'status': 'INACTIVE',\n", + " 'notPlayingReason': 'INACTIVE_INJURY',\n", + " 'notPlayingDescription': 'Right Wrist; Surgery',\n", + " 'order': 15,\n", + " 'personId': 1629641,\n", + " 'jerseyNum': '45',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Romeo Langford',\n", + " 'nameI': 'R. Langford',\n", + " 'firstName': 'Romeo',\n", + " 'familyName': 'Langford'},\n", + " {'status': 'INACTIVE',\n", + " 'notPlayingReason': 'INACTIVE_HEALTH_AND_SAFETY_PROTOCOLS',\n", + " 'order': 16,\n", + " 'personId': 1628369,\n", + " 'jerseyNum': '0',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Jayson Tatum',\n", + " 'nameI': 'J. Tatum',\n", + " 'firstName': 'Jayson',\n", + " 'familyName': 'Tatum'},\n", + " {'status': 'INACTIVE',\n", + " 'notPlayingReason': 'INACTIVE_HEALTH_AND_SAFETY_PROTOCOLS',\n", + " 'order': 17,\n", + " 'personId': 1629057,\n", + " 'jerseyNum': '44',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Robert Williams III',\n", + " 'nameI': 'R. Williams III',\n", + " 'firstName': 'Robert',\n", + " 'familyName': 'Williams III'}],\n", + " 'statistics': {'assists': 15,\n", + " 'assistsTurnoverRatio': 0.833333333333334,\n", + " 'benchPoints': 25,\n", + " 'biggestLead': 0,\n", + " 'biggestScoringRun': 9,\n", + " 'biggestScoringRunScore': '44-29',\n", + " 'blocks': 2,\n", + " 'blocksReceived': 7,\n", + " 'fastBreakPointsAttempted': 8,\n", + " 'fastBreakPointsMade': 4,\n", + " 'fastBreakPointsPercentage': 0.5,\n", + " 'fieldGoalsAttempted': 84,\n", + " 'fieldGoalsEffectiveAdjusted': 0.339285714285714,\n", + " 'fieldGoalsMade': 25,\n", + " 'fieldGoalsPercentage': 0.297619047619048,\n", + " 'foulsOffensive': 2,\n", + " 'foulsDrawn': 28,\n", + " 'foulsPersonal': 22,\n", + " 'foulsTeam': 20,\n", + " 'foulsTechnical': 1,\n", + " 'foulsTeamTechnical': 0,\n", + " 'freeThrowsAttempted': 29,\n", + " 'freeThrowsMade': 18,\n", + " 'freeThrowsPercentage': 0.620689655172414,\n", + " 'leadChanges': 0,\n", + " 'minutes': 'PT240M00.00S',\n", + " 'minutesCalculated': 'PT240M',\n", + " 'points': 75,\n", + " 'pointsAgainst': 105,\n", + " 'pointsFastBreak': 11,\n", + " 'pointsFromTurnovers': 11,\n", + " 'pointsInThePaint': 32,\n", + " 'pointsInThePaintAttempted': 32,\n", + " 'pointsInThePaintMade': 16,\n", + " 'pointsInThePaintPercentage': 0.5,\n", + " 'pointsSecondChance': 6,\n", + " 'reboundsDefensive': 29,\n", + " 'reboundsOffensive': 14,\n", + " 'reboundsPersonal': 43,\n", + " 'reboundsTeam': 10,\n", + " 'reboundsTeamDefensive': 3,\n", + " 'reboundsTeamOffensive': 7,\n", + " 'reboundsTotal': 53,\n", + " 'secondChancePointsAttempted': 11,\n", + " 'secondChancePointsMade': 1,\n", + " 'secondChancePointsPercentage': 0.0909090909090909,\n", + " 'steals': 10,\n", + " 'threePointersAttempted': 46,\n", + " 'threePointersMade': 7,\n", + " 'threePointersPercentage': 0.152173913043478,\n", + " 'timeLeading': 'PT00M00.00S',\n", + " 'timesTied': 1,\n", + " 'trueShootingAttempts': 96.76,\n", + " 'trueShootingPercentage': 0.38755684167011195,\n", + " 'turnovers': 17,\n", + " 'turnoversTeam': 1,\n", + " 'turnoversTotal': 18,\n", + " 'twoPointersAttempted': 38,\n", + " 'twoPointersMade': 18,\n", + " 'twoPointersPercentage': 0.473684210526316}},\n", + " 'awayTeam': {'teamId': 1610612752,\n", + " 'teamName': 'Knicks',\n", + " 'teamCity': 'New York',\n", + " 'teamTricode': 'NYK',\n", + " 'score': 105,\n", + " 'inBonus': '1',\n", + " 'timeoutsRemaining': 2,\n", + " 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 28},\n", + " {'period': 2, 'periodType': 'REGULAR', 'score': 20},\n", + " {'period': 3, 'periodType': 'REGULAR', 'score': 27},\n", + " {'period': 4, 'periodType': 'REGULAR', 'score': 30}],\n", + " 'players': [{'status': 'ACTIVE',\n", + " 'order': 1,\n", + " 'personId': 203493,\n", + " 'jerseyNum': '25',\n", + " 'position': 'SF',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 9,\n", + " 'fieldGoalsMade': 4,\n", + " 'fieldGoalsPercentage': 0.444444444444444,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 2,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 34.0,\n", + " 'minutes': 'PT28M10.00S',\n", + " 'minutesCalculated': 'PT28M',\n", + " 'plus': 70.0,\n", + " 'plusMinusPoints': 36.0,\n", + " 'points': 11,\n", + " 'pointsFastBreak': 3,\n", + " 'pointsInThePaint': 2,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 6,\n", + " 'reboundsOffensive': 1,\n", + " 'reboundsTotal': 7,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 8,\n", + " 'threePointersMade': 3,\n", + " 'threePointersPercentage': 0.375,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 1,\n", + " 'twoPointersMade': 1,\n", + " 'twoPointersPercentage': 1.0},\n", + " 'name': 'Reggie Bullock',\n", + " 'nameI': 'R. Bullock',\n", + " 'firstName': 'Reggie',\n", + " 'familyName': 'Bullock'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 2,\n", + " 'personId': 203944,\n", + " 'jerseyNum': '30',\n", + " 'position': 'PF',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 4,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 14,\n", + " 'fieldGoalsMade': 7,\n", + " 'fieldGoalsPercentage': 0.5,\n", + " 'foulsOffensive': 1,\n", + " 'foulsDrawn': 5,\n", + " 'foulsPersonal': 2,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 5,\n", + " 'freeThrowsMade': 4,\n", + " 'freeThrowsPercentage': 0.8,\n", + " 'minus': 43.0,\n", + " 'minutes': 'PT31M03.00S',\n", + " 'minutesCalculated': 'PT31M',\n", + " 'plus': 72.0,\n", + " 'plusMinusPoints': 29.0,\n", + " 'points': 20,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 8,\n", + " 'pointsSecondChance': 7,\n", + " 'reboundsDefensive': 12,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 12,\n", + " 'steals': 3,\n", + " 'threePointersAttempted': 5,\n", + " 'threePointersMade': 2,\n", + " 'threePointersPercentage': 0.4,\n", + " 'turnovers': 3,\n", + " 'twoPointersAttempted': 9,\n", + " 'twoPointersMade': 5,\n", + " 'twoPointersPercentage': 0.555555555555556},\n", + " 'name': 'Julius Randle',\n", + " 'nameI': 'J. Randle',\n", + " 'firstName': 'Julius',\n", + " 'familyName': 'Randle'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 3,\n", + " 'personId': 1629011,\n", + " 'jerseyNum': '23',\n", + " 'position': 'C',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 2,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 5,\n", + " 'fieldGoalsMade': 4,\n", + " 'fieldGoalsPercentage': 0.8,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 1,\n", + " 'foulsPersonal': 4,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 30.0,\n", + " 'minutes': 'PT24M12.97S',\n", + " 'minutesCalculated': 'PT24M',\n", + " 'plus': 58.0,\n", + " 'plusMinusPoints': 28.0,\n", + " 'points': 8,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 8,\n", + " 'pointsSecondChance': 4,\n", + " 'reboundsDefensive': 3,\n", + " 'reboundsOffensive': 4,\n", + " 'reboundsTotal': 7,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 5,\n", + " 'twoPointersMade': 4,\n", + " 'twoPointersPercentage': 0.8},\n", + " 'name': 'Mitchell Robinson',\n", + " 'nameI': 'M. Robinson',\n", + " 'firstName': 'Mitchell',\n", + " 'familyName': 'Robinson'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 4,\n", + " 'personId': 1629628,\n", + " 'jerseyNum': '9',\n", + " 'position': 'SG',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 3,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 11,\n", + " 'fieldGoalsMade': 5,\n", + " 'fieldGoalsPercentage': 0.45454545454545503,\n", + " 'foulsOffensive': 1,\n", + " 'foulsDrawn': 6,\n", + " 'foulsPersonal': 3,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 8,\n", + " 'freeThrowsMade': 7,\n", + " 'freeThrowsPercentage': 0.875,\n", + " 'minus': 40.0,\n", + " 'minutes': 'PT29M14.00S',\n", + " 'minutesCalculated': 'PT29M',\n", + " 'plus': 72.0,\n", + " 'plusMinusPoints': 32.0,\n", + " 'points': 19,\n", + " 'pointsFastBreak': 2,\n", + " 'pointsInThePaint': 6,\n", + " 'pointsSecondChance': 6,\n", + " 'reboundsDefensive': 7,\n", + " 'reboundsOffensive': 4,\n", + " 'reboundsTotal': 11,\n", + " 'steals': 2,\n", + " 'threePointersAttempted': 4,\n", + " 'threePointersMade': 2,\n", + " 'threePointersPercentage': 0.5,\n", + " 'turnovers': 4,\n", + " 'twoPointersAttempted': 7,\n", + " 'twoPointersMade': 3,\n", + " 'twoPointersPercentage': 0.428571428571429},\n", + " 'name': 'RJ Barrett',\n", + " 'nameI': 'R. Barrett',\n", + " 'firstName': 'RJ',\n", + " 'familyName': 'Barrett'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 5,\n", + " 'personId': 203901,\n", + " 'jerseyNum': '6',\n", + " 'position': 'PG',\n", + " 'starter': '1',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 3,\n", + " 'blocks': 1,\n", + " 'blocksReceived': 1,\n", + " 'fieldGoalsAttempted': 9,\n", + " 'fieldGoalsMade': 3,\n", + " 'fieldGoalsPercentage': 0.333333333333333,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 2,\n", + " 'foulsPersonal': 2,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 3,\n", + " 'freeThrowsMade': 3,\n", + " 'freeThrowsPercentage': 1.0,\n", + " 'minus': 34.0,\n", + " 'minutes': 'PT23M10.00S',\n", + " 'minutesCalculated': 'PT23M',\n", + " 'plus': 49.0,\n", + " 'plusMinusPoints': 15.0,\n", + " 'points': 9,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 4,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 3,\n", + " 'reboundsOffensive': 1,\n", + " 'reboundsTotal': 4,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 1,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 2,\n", + " 'twoPointersAttempted': 8,\n", + " 'twoPointersMade': 3,\n", + " 'twoPointersPercentage': 0.375},\n", + " 'name': 'Elfrid Payton',\n", + " 'nameI': 'E. Payton',\n", + " 'firstName': 'Elfrid',\n", + " 'familyName': 'Payton'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 6,\n", + " 'personId': 203457,\n", + " 'jerseyNum': '3',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 2,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 3,\n", + " 'fieldGoalsMade': 2,\n", + " 'fieldGoalsPercentage': 0.666666666666666,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 3,\n", + " 'foulsPersonal': 4,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 2,\n", + " 'freeThrowsMade': 1,\n", + " 'freeThrowsPercentage': 0.5,\n", + " 'minus': 45.0,\n", + " 'minutes': 'PT23M47.03S',\n", + " 'minutesCalculated': 'PT24M',\n", + " 'plus': 47.0,\n", + " 'plusMinusPoints': 2.0,\n", + " 'points': 5,\n", + " 'pointsFastBreak': 2,\n", + " 'pointsInThePaint': 4,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 4,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 4,\n", + " 'steals': 2,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 3,\n", + " 'twoPointersMade': 2,\n", + " 'twoPointersPercentage': 0.666666666666666},\n", + " 'name': 'Nerlens Noel',\n", + " 'nameI': 'N. Noel',\n", + " 'firstName': 'Nerlens',\n", + " 'familyName': 'Noel'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 7,\n", + " 'personId': 203085,\n", + " 'jerseyNum': '8',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 2,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 3,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 1,\n", + " 'foulsDrawn': 1,\n", + " 'foulsPersonal': 2,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 32.0,\n", + " 'minutes': 'PT16M19.00S',\n", + " 'minutesCalculated': 'PT16M',\n", + " 'plus': 32.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 1,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 1,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 1,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 2,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Austin Rivers',\n", + " 'nameI': 'A. Rivers',\n", + " 'firstName': 'Austin',\n", + " 'familyName': 'Rivers'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 8,\n", + " 'personId': 1630193,\n", + " 'jerseyNum': '5',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 8,\n", + " 'blocks': 1,\n", + " 'blocksReceived': 1,\n", + " 'fieldGoalsAttempted': 12,\n", + " 'fieldGoalsMade': 7,\n", + " 'fieldGoalsPercentage': 0.583333333333333,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 2,\n", + " 'foulsPersonal': 4,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 1,\n", + " 'freeThrowsMade': 1,\n", + " 'freeThrowsPercentage': 1.0,\n", + " 'minus': 32.0,\n", + " 'minutes': 'PT21M06.00S',\n", + " 'minutesCalculated': 'PT21M',\n", + " 'plus': 52.0,\n", + " 'plusMinusPoints': 20.0,\n", + " 'points': 17,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 10,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 4,\n", + " 'threePointersMade': 2,\n", + " 'threePointersPercentage': 0.5,\n", + " 'turnovers': 2,\n", + " 'twoPointersAttempted': 8,\n", + " 'twoPointersMade': 5,\n", + " 'twoPointersPercentage': 0.625},\n", + " 'name': 'Immanuel Quickley',\n", + " 'nameI': 'I. Quickley',\n", + " 'firstName': 'Immanuel',\n", + " 'familyName': 'Quickley'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 9,\n", + " 'personId': 1630167,\n", + " 'jerseyNum': '1',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 1,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 8,\n", + " 'fieldGoalsMade': 5,\n", + " 'fieldGoalsPercentage': 0.625,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 32.0,\n", + " 'minutes': 'PT16M57.00S',\n", + " 'minutesCalculated': 'PT17M',\n", + " 'plus': 33.0,\n", + " 'plusMinusPoints': 1.0,\n", + " 'points': 12,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 6,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 5,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 5,\n", + " 'steals': 1,\n", + " 'threePointersAttempted': 4,\n", + " 'threePointersMade': 2,\n", + " 'threePointersPercentage': 0.5,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 4,\n", + " 'twoPointersMade': 3,\n", + " 'twoPointersPercentage': 0.75},\n", + " 'name': 'Obi Toppin',\n", + " 'nameI': 'O. Toppin',\n", + " 'firstName': 'Obi',\n", + " 'familyName': 'Toppin'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 10,\n", + " 'personId': 1628995,\n", + " 'jerseyNum': '20',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 1,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 3,\n", + " 'fieldGoalsMade': 1,\n", + " 'fieldGoalsPercentage': 0.333333333333333,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 1,\n", + " 'foulsPersonal': 3,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 27.0,\n", + " 'minutes': 'PT15M29.00S',\n", + " 'minutesCalculated': 'PT16M',\n", + " 'plus': 30.0,\n", + " 'plusMinusPoints': 3.0,\n", + " 'points': 3,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 2,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 2,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 2,\n", + " 'threePointersMade': 1,\n", + " 'threePointersPercentage': 0.5,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 1,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Kevin Knox II',\n", + " 'nameI': 'K. Knox II',\n", + " 'firstName': 'Kevin',\n", + " 'familyName': 'Knox II'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 11,\n", + " 'personId': 1628372,\n", + " 'jerseyNum': '4',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 2,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 1,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 2,\n", + " 'freeThrowsMade': 1,\n", + " 'freeThrowsPercentage': 0.5,\n", + " 'minus': 9.0,\n", + " 'minutes': 'PT03M44.00S',\n", + " 'minutesCalculated': 'PT04M',\n", + " 'plus': 4.0,\n", + " 'plusMinusPoints': -5.0,\n", + " 'points': 1,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 1,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 1,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Dennis Smith Jr.',\n", + " 'nameI': 'D. Smith Jr.',\n", + " 'firstName': 'Dennis',\n", + " 'familyName': 'Smith Jr.'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 12,\n", + " 'personId': 1629033,\n", + " 'jerseyNum': '21',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 1,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 2,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 9.0,\n", + " 'minutes': 'PT03M31.00S',\n", + " 'minutesCalculated': 'PT04M',\n", + " 'plus': 3.0,\n", + " 'plusMinusPoints': -6.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 1,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Theo Pinson',\n", + " 'nameI': 'T. Pinson',\n", + " 'firstName': 'Theo',\n", + " 'familyName': 'Pinson'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 13,\n", + " 'personId': 1629649,\n", + " 'jerseyNum': '17',\n", + " 'starter': '0',\n", + " 'oncourt': '1',\n", + " 'played': '1',\n", + " 'statistics': {'assists': 1,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 8.0,\n", + " 'minutes': 'PT03M17.00S',\n", + " 'minutesCalculated': 'PT03M',\n", + " 'plus': 3.0,\n", + " 'plusMinusPoints': -5.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 1,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Ignas Brazdeikis',\n", + " 'nameI': 'I. Brazdeikis',\n", + " 'firstName': 'Ignas',\n", + " 'familyName': 'Brazdeikis'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 14,\n", + " 'personId': 201959,\n", + " 'jerseyNum': '67',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Taj Gibson',\n", + " 'nameI': 'T. Gibson',\n", + " 'firstName': 'Taj',\n", + " 'familyName': 'Gibson'},\n", + " {'status': 'ACTIVE',\n", + " 'order': 15,\n", + " 'personId': 1629607,\n", + " 'jerseyNum': '0',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Jared Harper',\n", + " 'nameI': 'J. Harper',\n", + " 'firstName': 'Jared',\n", + " 'familyName': 'Harper'},\n", + " {'status': 'INACTIVE',\n", + " 'notPlayingReason': 'INACTIVE_INJURY',\n", + " 'notPlayingDescription': 'Left Ankle; sprained',\n", + " 'order': 16,\n", + " 'personId': 202692,\n", + " 'jerseyNum': '18',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Alec Burks',\n", + " 'nameI': 'A. Burks',\n", + " 'firstName': 'Alec',\n", + " 'familyName': 'Burks'},\n", + " {'status': 'INACTIVE',\n", + " 'notPlayingReason': 'INACTIVE_INJURY',\n", + " 'notPlayingDescription': 'Right Knee; sprained',\n", + " 'order': 17,\n", + " 'personId': 1628373,\n", + " 'jerseyNum': '11',\n", + " 'starter': '0',\n", + " 'oncourt': '0',\n", + " 'played': '0',\n", + " 'statistics': {'assists': 0,\n", + " 'blocks': 0,\n", + " 'blocksReceived': 0,\n", + " 'fieldGoalsAttempted': 0,\n", + " 'fieldGoalsMade': 0,\n", + " 'fieldGoalsPercentage': 0.0,\n", + " 'foulsOffensive': 0,\n", + " 'foulsDrawn': 0,\n", + " 'foulsPersonal': 0,\n", + " 'foulsTechnical': 0,\n", + " 'freeThrowsAttempted': 0,\n", + " 'freeThrowsMade': 0,\n", + " 'freeThrowsPercentage': 0.0,\n", + " 'minus': 0.0,\n", + " 'minutes': 'PT00M00.00S',\n", + " 'minutesCalculated': 'PT00M',\n", + " 'plus': 0.0,\n", + " 'plusMinusPoints': 0.0,\n", + " 'points': 0,\n", + " 'pointsFastBreak': 0,\n", + " 'pointsInThePaint': 0,\n", + " 'pointsSecondChance': 0,\n", + " 'reboundsDefensive': 0,\n", + " 'reboundsOffensive': 0,\n", + " 'reboundsTotal': 0,\n", + " 'steals': 0,\n", + " 'threePointersAttempted': 0,\n", + " 'threePointersMade': 0,\n", + " 'threePointersPercentage': 0.0,\n", + " 'turnovers': 0,\n", + " 'twoPointersAttempted': 0,\n", + " 'twoPointersMade': 0,\n", + " 'twoPointersPercentage': 0.0},\n", + " 'name': 'Frank Ntilikina',\n", + " 'nameI': 'F. Ntilikina',\n", + " 'firstName': 'Frank',\n", + " 'familyName': 'Ntilikina'}],\n", + " 'statistics': {'assists': 22,\n", + " 'assistsTurnoverRatio': 1.29411764705882,\n", + " 'benchPoints': 38,\n", + " 'biggestLead': 37,\n", + " 'biggestLeadScore': '101-64',\n", + " 'biggestScoringRun': 12,\n", + " 'biggestScoringRunScore': '101-64',\n", + " 'blocks': 7,\n", + " 'blocksReceived': 2,\n", + " 'fastBreakPointsAttempted': 3,\n", + " 'fastBreakPointsMade': 2,\n", + " 'fastBreakPointsPercentage': 0.666666666666666,\n", + " 'fieldGoalsAttempted': 80,\n", + " 'fieldGoalsEffectiveAdjusted': 0.55,\n", + " 'fieldGoalsMade': 38,\n", + " 'fieldGoalsPercentage': 0.475,\n", + " 'foulsOffensive': 3,\n", + " 'foulsDrawn': 22,\n", + " 'foulsPersonal': 28,\n", + " 'foulsTeam': 25,\n", + " 'foulsTechnical': 0,\n", + " 'foulsTeamTechnical': 0,\n", + " 'freeThrowsAttempted': 21,\n", + " 'freeThrowsMade': 17,\n", + " 'freeThrowsPercentage': 0.8095238095238101,\n", + " 'leadChanges': 0,\n", + " 'minutes': 'PT240M00.00S',\n", + " 'minutesCalculated': 'PT240M',\n", + " 'points': 105,\n", + " 'pointsAgainst': 75,\n", + " 'pointsFastBreak': 7,\n", + " 'pointsFromTurnovers': 22,\n", + " 'pointsInThePaint': 48,\n", + " 'pointsInThePaintAttempted': 41,\n", + " 'pointsInThePaintMade': 24,\n", + " 'pointsInThePaintPercentage': 0.585365853658536,\n", + " 'pointsSecondChance': 17,\n", + " 'reboundsDefensive': 43,\n", + " 'reboundsOffensive': 10,\n", + " 'reboundsPersonal': 53,\n", + " 'reboundsTeam': 10,\n", + " 'reboundsTeamDefensive': 6,\n", + " 'reboundsTeamOffensive': 4,\n", + " 'reboundsTotal': 63,\n", + " 'secondChancePointsAttempted': 7,\n", + " 'secondChancePointsMade': 5,\n", + " 'secondChancePointsPercentage': 0.714285714285714,\n", + " 'steals': 11,\n", + " 'threePointersAttempted': 31,\n", + " 'threePointersMade': 12,\n", + " 'threePointersPercentage': 0.387096774193548,\n", + " 'timeLeading': 'PT46M30.00S',\n", + " 'timesTied': 1,\n", + " 'trueShootingAttempts': 89.24,\n", + " 'trueShootingPercentage': 0.588301210219632,\n", + " 'turnovers': 16,\n", + " 'turnoversTeam': 1,\n", + " 'turnoversTotal': 17,\n", + " 'twoPointersAttempted': 49,\n", + " 'twoPointersMade': 26,\n", + " 'twoPointersPercentage': 0.530612244897959}}}" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Data Sets\n", + "box.game.get_dict() #equal to box.get_dict()['game']\n", + "#box.arena.get_dict() #equal to box.get_dict()['game']['arena']\n", + "#box.away_team.get_dict() #equal to box.get_dict()['game']['awayTeam']\n", + "#box.away_team_player_stats.get_dict() #equal to box.get_dict()['game']['awayTeam']['players']\n", + "#box.away_team_stats.get_dict() #equal to box.get_dict()['game']['homeTeam'] w/o ['players']\n", + "#box.home_team.get_dict() #equal to box.get_dict()['game']['homeTeam']\n", + "#box.home_team_player_stats.get_dict() #equal to box.get_dict()['game']['homeTeam']['players']\n", + "#box.home_team_stats.get_dict() #equal to box.get_dict()['game']['homeTeam'] w/o ['players']\n", + "#box.game_details.get_dict() #equal to box.get_dict()['game'] scrubbed of all other dictionaries\n", + "#box.officials.get_dict() #equal to box.get_dict()['game']['officials']" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "203493: Reggie Bullock: 11 PTS\n", + "203944: Julius Randle: 20 PTS\n", + "1629011: Mitchell Robinson: 8 PTS\n", + "1629628: RJ Barrett: 19 PTS\n", + "203901: Elfrid Payton: 9 PTS\n", + "203457: Nerlens Noel: 5 PTS\n", + "203085: Austin Rivers: 0 PTS\n", + "1630193: Immanuel Quickley: 17 PTS\n", + "1630167: Obi Toppin: 12 PTS\n", + "1628995: Kevin Knox II: 3 PTS\n", + "1628372: Dennis Smith Jr.: 1 PTS\n", + "1629033: Theo Pinson: 0 PTS\n", + "1629649: Ignas Brazdeikis: 0 PTS\n", + "201959: Taj Gibson: 0 PTS\n", + "1629607: Jared Harper: 0 PTS\n", + "202692: Alec Burks: 0 PTS\n", + "1628373: Frank Ntilikina: 0 PTS\n" + ] + } + ], + "source": [ + "# Getting Box Scores. \n", + "# Note: home_team & away_team have the identicial data structure.\n", + "players = box.away_team.get_dict()['players']\n", + "f = \"{player_id}: {name}: {points} PTS\"\n", + "for player in players:\n", + " print(f.format(player_id=player['personId'],name=player['name'],points=player['statistics']['points']))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Play By Play Data" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2: 1:PT12M00.00S (period)\n", + "4: 1:PT11M58.00S Grant Williams (jumpball)\n", + "7: 1:PT11M47.00S Julius Randle (foul)\n", + "9: 1:PT11M47.00S Grant Williams (freethrow)\n", + "10: 1:PT11M47.00S (rebound)\n", + "11: 1:PT11M47.00S Grant Williams (freethrow)\n", + "12: 1:PT11M45.00S Julius Randle (rebound)\n", + "13: 1:PT11M25.00S RJ Barrett (turnover)\n", + "14: 1:PT11M25.00S Kemba Walker (steal)\n", + "15: 1:PT11M21.00S Kemba Walker (turnover)\n", + "16: 1:PT11M07.00S RJ Barrett (2pt)\n", + "17: 1:PT11M06.00S Mitchell Robinson (rebound)\n", + "18: 1:PT11M06.00S Mitchell Robinson (2pt)\n", + "19: 1:PT10M53.00S Tristan Thompson (2pt)\n", + "21: 1:PT10M26.00S RJ Barrett (3pt)\n", + "22: 1:PT10M24.00S Reggie Bullock (rebound)\n", + "23: 1:PT10M17.00S Julius Randle (3pt)\n", + "24: 1:PT10M01.00S Marcus Smart (3pt)\n", + "25: 1:PT09M58.00S Elfrid Payton (rebound)\n", + "26: 1:PT09M50.00S Elfrid Payton (2pt)\n", + "27: 1:PT09M50.00S (timeout)\n", + "28: 1:PT09M35.00S Kemba Walker (3pt)\n", + "29: 1:PT09M29.00S RJ Barrett (rebound)\n", + "30: 1:PT09M20.00S Reggie Bullock (3pt)\n", + "31: 1:PT09M18.00S Kemba Walker (rebound)\n", + "32: 1:PT09M09.00S Grant Williams (2pt)\n", + "34: 1:PT08M57.00S Kemba Walker (foul)\n", + "36: 1:PT08M43.00S Julius Randle (2pt)\n", + "37: 1:PT08M41.00S Grant Williams (rebound)\n", + "38: 1:PT08M31.00S Kemba Walker (turnover)\n", + "39: 1:PT08M20.00S Reggie Bullock (3pt)\n", + "40: 1:PT08M16.00S Jaylen Brown (rebound)\n", + "41: 1:PT08M09.00S Mitchell Robinson (foul)\n", + "43: 1:PT07M58.00S Grant Williams (3pt)\n", + "44: 1:PT07M56.00S RJ Barrett (rebound)\n", + "45: 1:PT07M53.00S Grant Williams (foul)\n", + "47: 1:PT07M53.00S Julius Randle (freethrow)\n", + "48: 1:PT07M53.00S (rebound)\n", + "49: 1:PT07M53.00S Julius Randle (freethrow)\n", + "50: 1:PT07M36.00S Kemba Walker (turnover)\n", + "51: 1:PT07M36.00S Julius Randle (steal)\n", + "52: 1:PT07M24.00S RJ Barrett (foul)\n", + "54: 1:PT07M24.00S RJ Barrett (turnover)\n", + "55: 1:PT07M14.00S (stoppage)\n", + "56: 1:PT07M14.00S Kemba Walker (substitution)\n", + "57: 1:PT07M14.00S Jeff Teague (substitution)\n", + "58: 1:PT07M06.00S Jaylen Brown (3pt)\n", + "59: 1:PT07M02.00S Julius Randle (rebound)\n", + "60: 1:PT06M52.00S Reggie Bullock (3pt)\n", + "62: 1:PT06M36.00S Marcus Smart (3pt)\n", + "63: 1:PT06M33.00S Jaylen Brown (rebound)\n", + "64: 1:PT06M31.00S Jaylen Brown (2pt)\n", + "65: 1:PT06M31.00S Tristan Thompson (rebound)\n", + "66: 1:PT06M27.00S Tristan Thompson (turnover)\n", + "67: 1:PT06M27.00S RJ Barrett (steal)\n", + "68: 1:PT06M12.00S Elfrid Payton (2pt)\n", + "69: 1:PT06M10.00S Mitchell Robinson (rebound)\n", + "70: 1:PT06M08.00S Reggie Bullock (3pt)\n", + "71: 1:PT06M05.00S (rebound)\n", + "72: 1:PT06M05.00S (stoppage)\n", + "73: 1:PT05M52.00S Jaylen Brown (3pt)\n", + "75: 1:PT05M41.00S Jeff Teague (foul)\n", + "77: 1:PT05M41.00S Elfrid Payton (freethrow)\n", + "78: 1:PT05M41.00S Grant Williams (substitution)\n", + "79: 1:PT05M41.00S Tristan Thompson (substitution)\n", + "80: 1:PT05M41.00S Daniel Theis (substitution)\n", + "81: 1:PT05M41.00S Semi Ojeleye (substitution)\n", + "82: 1:PT05M41.00S Elfrid Payton (freethrow)\n", + "83: 1:PT05M17.00S Jeff Teague (2pt)\n", + "84: 1:PT05M13.00S RJ Barrett (rebound)\n", + "85: 1:PT05M02.00S RJ Barrett (2pt)\n", + "86: 1:PT04M43.00S Jeff Teague (3pt)\n", + "87: 1:PT04M43.00S Mitchell Robinson (block)\n", + "88: 1:PT04M43.00S (rebound)\n", + "89: 1:PT04M43.00S Jeff Teague (foul)\n", + "91: 1:PT04M43.00S Mitchell Robinson (substitution)\n", + "92: 1:PT04M43.00S Reggie Bullock (substitution)\n", + "93: 1:PT04M43.00S Austin Rivers (substitution)\n", + "94: 1:PT04M43.00S Nerlens Noel (substitution)\n", + "95: 1:PT04M27.00S Julius Randle (2pt)\n", + "96: 1:PT04M26.00S Jeff Teague (rebound)\n", + "97: 1:PT04M20.00S Jaylen Brown (3pt)\n", + "99: 1:PT04M06.00S Julius Randle (2pt)\n", + "101: 1:PT03M54.00S Jaylen Brown (3pt)\n", + "103: 1:PT03M32.00S RJ Barrett (2pt)\n", + "104: 1:PT03M31.00S RJ Barrett (rebound)\n", + "105: 1:PT03M31.00S Jaylen Brown (foul)\n", + "107: 1:PT03M31.00S RJ Barrett (freethrow)\n", + "108: 1:PT03M31.00S Marcus Smart (substitution)\n", + "109: 1:PT03M31.00S Payton Pritchard (substitution)\n", + "110: 1:PT03M31.00S RJ Barrett (freethrow)\n", + "111: 1:PT03M21.00S Elfrid Payton (foul)\n", + "113: 1:PT03M10.00S Payton Pritchard (3pt)\n", + "114: 1:PT03M07.00S Nerlens Noel (rebound)\n", + "115: 1:PT02M51.00S Julius Randle (3pt)\n", + "116: 1:PT02M47.00S RJ Barrett (rebound)\n", + "117: 1:PT02M44.00S Julius Randle (2pt)\n", + "119: 1:PT02M27.00S Daniel Theis (2pt)\n", + "121: 1:PT02M07.00S RJ Barrett (3pt)\n", + "123: 1:PT01M55.00S Jaylen Brown (2pt)\n", + "125: 1:PT01M43.00S Austin Rivers (3pt)\n", + "126: 1:PT01M40.00S Daniel Theis (rebound)\n", + "127: 1:PT01M32.00S Jeff Teague (2pt)\n", + "128: 1:PT01M32.00S Julius Randle (rebound)\n", + "129: 1:PT01M11.00S Elfrid Payton (2pt)\n", + "130: 1:PT01M08.00S Jeff Teague (rebound)\n", + "131: 1:PT01M05.00S Jeff Teague (turnover)\n", + "132: 1:PT01M05.00S Elfrid Payton (steal)\n", + "133: 1:PT01M02.00S Elfrid Payton (2pt)\n", + "134: 1:PT01M00.00S RJ Barrett (rebound)\n", + "135: 1:PT01M00.00S Jaylen Brown (foul)\n", + "137: 1:PT01M00.00S (timeout)\n", + "139: 1:PT01M00.00S Elfrid Payton (substitution)\n", + "141: 1:PT01M00.00S Immanuel Quickley (substitution)\n", + "142: 1:PT01M00.00S RJ Barrett (freethrow)\n", + "143: 1:PT01M00.00S RJ Barrett (freethrow)\n", + "145: 1:PT00M45.00S Jaylen Brown (turnover)\n", + "146: 1:PT00M45.00S RJ Barrett (steal)\n", + "147: 1:PT00M34.70S Julius Randle (2pt)\n", + "148: 1:PT00M31.80S Daniel Theis (rebound)\n", + "175: 1:PT00M31.80S Daniel Theis (turnover)\n", + "183: 1:PT00M31.80S Julius Randle (steal)\n", + "149: 1:PT00M31.80S Julius Randle (2pt)\n", + "150: 1:PT00M19.10S Semi Ojeleye (3pt)\n", + "151: 1:PT00M17.70S Daniel Theis (rebound)\n", + "152: 1:PT00M13.30S Payton Pritchard (jumpball)\n", + "155: 1:PT00M01.40S (turnover)\n", + "156: 1:PT00M01.40S (stoppage)\n", + "157: 1:PT00M01.40S Payton Pritchard (substitution)\n", + "158: 1:PT00M01.40S Tristan Thompson (substitution)\n", + "159: 1:PT00M00.00S (period)\n", + "160: 2:PT12M00.00S Jaylen Brown (substitution)\n", + "161: 2:PT12M00.00S Jeff Teague (substitution)\n", + "162: 2:PT12M00.00S Tristan Thompson (substitution)\n", + "163: 2:PT12M00.00S RJ Barrett (substitution)\n", + "164: 2:PT12M00.00S Julius Randle (substitution)\n", + "165: 2:PT12M00.00S Payton Pritchard (substitution)\n", + "166: 2:PT12M00.00S Javonte Green (substitution)\n", + "167: 2:PT12M00.00S Kemba Walker (substitution)\n", + "168: 2:PT12M00.00S Obi Toppin (substitution)\n", + "169: 2:PT12M00.00S Kevin Knox II (substitution)\n", + "170: 2:PT12M00.00S (period)\n", + "171: 2:PT11M41.00S Immanuel Quickley (3pt)\n", + "172: 2:PT11M38.00S Javonte Green (rebound)\n", + "173: 2:PT11M26.00S Kemba Walker (2pt)\n", + "174: 2:PT11M23.00S (rebound)\n", + "176: 2:PT11M23.00S (stoppage)\n", + "177: 2:PT11M01.00S Obi Toppin (3pt)\n", + "178: 2:PT10M59.00S Javonte Green (rebound)\n", + "179: 2:PT10M48.00S Kemba Walker (2pt)\n", + "180: 2:PT10M34.00S Obi Toppin (2pt)\n", + "182: 2:PT10M22.00S Kemba Walker (3pt)\n", + "184: 2:PT09M59.00S Austin Rivers (2pt)\n", + "185: 2:PT09M59.00S Payton Pritchard (rebound)\n", + "186: 2:PT09M52.00S Kemba Walker (3pt)\n", + "187: 2:PT09M49.00S Austin Rivers (rebound)\n", + "188: 2:PT09M29.00S Immanuel Quickley (2pt)\n", + "247: 2:PT09M29.00S Payton Pritchard (block)\n", + "189: 2:PT09M27.00S Daniel Theis (rebound)\n", + "190: 2:PT09M25.00S Daniel Theis (turnover)\n", + "191: 2:PT09M25.00S Nerlens Noel (steal)\n", + "192: 2:PT09M22.00S Immanuel Quickley (3pt)\n", + "193: 2:PT09M12.00S Nerlens Noel (foul)\n", + "195: 2:PT09M03.00S Daniel Theis (2pt)\n", + "197: 2:PT08M44.00S Immanuel Quickley (2pt)\n", + "198: 2:PT08M42.00S Semi Ojeleye (rebound)\n", + "199: 2:PT08M33.00S Kemba Walker (2pt)\n", + "200: 2:PT08M30.00S Kevin Knox II (rebound)\n", + "201: 2:PT08M21.00S Kevin Knox II (2pt)\n", + "202: 2:PT08M19.00S (rebound)\n", + "203: 2:PT08M19.00S (stoppage)\n", + "204: 2:PT08M19.00S Daniel Theis (substitution)\n", + "205: 2:PT08M19.00S Tristan Thompson (substitution)\n", + "206: 2:PT08M08.00S Kemba Walker (turnover)\n", + "207: 2:PT07M56.00S Kevin Knox II (3pt)\n", + "208: 2:PT07M52.00S Kemba Walker (rebound)\n", + "209: 2:PT07M43.00S Semi Ojeleye (foul)\n", + "211: 2:PT07M43.00S Semi Ojeleye (turnover)\n", + "212: 2:PT07M43.00S Nerlens Noel (substitution)\n", + "213: 2:PT07M43.00S Mitchell Robinson (substitution)\n", + "215: 2:PT07M24.00S Immanuel Quickley (2pt)\n", + "216: 2:PT07M14.00S Kemba Walker (2pt)\n", + "217: 2:PT07M14.00S Mitchell Robinson (foul)\n", + "219: 2:PT07M14.00S Kemba Walker (freethrow)\n", + "220: 2:PT06M53.00S Obi Toppin (turnover)\n", + "221: 2:PT06M53.00S (timeout)\n", + "222: 2:PT06M37.00S Javonte Green (2pt)\n", + "224: 2:PT06M11.00S Obi Toppin (2pt)\n", + "226: 2:PT05M59.00S Semi Ojeleye (3pt)\n", + "227: 2:PT05M57.00S Tristan Thompson (rebound)\n", + "228: 2:PT05M55.00S Tristan Thompson (2pt)\n", + "229: 2:PT05M54.00S Kevin Knox II (rebound)\n", + "230: 2:PT05M42.00S Obi Toppin (2pt)\n", + "231: 2:PT05M40.00S Payton Pritchard (rebound)\n", + "232: 2:PT05M34.00S Semi Ojeleye (3pt)\n", + "233: 2:PT05M32.00S Mitchell Robinson (rebound)\n", + "234: 2:PT05M19.00S Austin Rivers (foul)\n", + "236: 2:PT05M19.00S Austin Rivers (turnover)\n", + "237: 2:PT05M19.00S Kemba Walker (substitution)\n", + "238: 2:PT05M19.00S Marcus Smart (substitution)\n", + "239: 2:PT05M02.00S Semi Ojeleye (3pt)\n", + "240: 2:PT04M59.00S Mitchell Robinson (rebound)\n", + "241: 2:PT04M59.00S Payton Pritchard (substitution)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "242: 2:PT04M59.00S Austin Rivers (substitution)\n", + "243: 2:PT04M59.00S Kevin Knox II (substitution)\n", + "244: 2:PT04M59.00S Jaylen Brown (substitution)\n", + "245: 2:PT04M59.00S RJ Barrett (substitution)\n", + "246: 2:PT04M59.00S Reggie Bullock (substitution)\n", + "248: 2:PT04M57.00S Semi Ojeleye (jumpball)\n", + "251: 2:PT04M57.00S Mitchell Robinson (turnover)\n", + "252: 2:PT04M57.00S Tristan Thompson (steal)\n", + "253: 2:PT04M48.00S Marcus Smart (2pt)\n", + "254: 2:PT04M44.00S Javonte Green (rebound)\n", + "255: 2:PT04M38.00S Marcus Smart (2pt)\n", + "256: 2:PT04M36.00S Obi Toppin (rebound)\n", + "257: 2:PT04M26.00S Immanuel Quickley (2pt)\n", + "271: 2:PT04M09.00S Jaylen Brown (turnover)\n", + "272: 2:PT04M09.00S Reggie Bullock (steal)\n", + "262: 2:PT04M05.00S Marcus Smart (foul)\n", + "264: 2:PT04M05.00S RJ Barrett (freethrow)\n", + "265: 2:PT04M05.00S (rebound)\n", + "266: 2:PT04M05.00S Semi Ojeleye (substitution)\n", + "267: 2:PT04M05.00S Obi Toppin (substitution)\n", + "268: 2:PT04M05.00S Grant Williams (substitution)\n", + "269: 2:PT04M05.00S Julius Randle (substitution)\n", + "270: 2:PT04M05.00S RJ Barrett (freethrow)\n", + "273: 2:PT03M46.00S Jaylen Brown (2pt)\n", + "274: 2:PT03M44.00S Julius Randle (rebound)\n", + "275: 2:PT03M33.00S Immanuel Quickley (turnover)\n", + "276: 2:PT03M33.00S Jaylen Brown (steal)\n", + "277: 2:PT03M30.00S Tristan Thompson (2pt)\n", + "278: 2:PT03M26.00S Reggie Bullock (rebound)\n", + "279: 2:PT03M23.00S Immanuel Quickley (2pt)\n", + "280: 2:PT03M01.00S Jaylen Brown (2pt)\n", + "281: 2:PT03M01.00S Reggie Bullock (rebound)\n", + "282: 2:PT02M50.00S Immanuel Quickley (2pt)\n", + "283: 2:PT02M36.00S Immanuel Quickley (foul)\n", + "285: 2:PT02M36.00S (timeout)\n", + "286: 2:PT02M36.00S Javonte Green (substitution)\n", + "287: 2:PT02M36.00S Immanuel Quickley (substitution)\n", + "288: 2:PT02M36.00S Jeff Teague (substitution)\n", + "289: 2:PT02M36.00S Elfrid Payton (substitution)\n", + "290: 2:PT02M28.00S Marcus Smart (3pt)\n", + "291: 2:PT02M27.00S (rebound)\n", + "292: 2:PT02M27.00S (stoppage)\n", + "293: 2:PT02M14.00S RJ Barrett (turnover)\n", + "294: 2:PT02M14.00S Marcus Smart (steal)\n", + "295: 2:PT02M04.00S Marcus Smart (2pt)\n", + "297: 2:PT02M04.00S RJ Barrett (foul)\n", + "299: 2:PT02M04.00S Marcus Smart (freethrow)\n", + "300: 2:PT02M02.00S Grant Williams (rebound)\n", + "301: 2:PT01M54.00S Jaylen Brown (3pt)\n", + "302: 2:PT01M51.00S Elfrid Payton (rebound)\n", + "303: 2:PT01M43.00S Reggie Bullock (2pt)\n", + "305: 2:PT01M32.00S Grant Williams (3pt)\n", + "306: 2:PT01M30.00S RJ Barrett (rebound)\n", + "307: 2:PT01M26.00S Grant Williams (foul)\n", + "309: 2:PT01M17.00S Reggie Bullock (jumpball)\n", + "312: 2:PT01M09.00S Elfrid Payton (2pt)\n", + "313: 2:PT01M09.00S Tristan Thompson (block)\n", + "314: 2:PT01M04.00S Mitchell Robinson (rebound)\n", + "315: 2:PT01M04.00S Mitchell Robinson (2pt)\n", + "316: 2:PT01M04.00S Elfrid Payton (rebound)\n", + "317: 2:PT01M00.00S Julius Randle (turnover)\n", + "318: 2:PT00M50.30S Mitchell Robinson (foul)\n", + "320: 2:PT00M50.30S Jaylen Brown (freethrow)\n", + "321: 2:PT00M50.30S Mitchell Robinson (substitution)\n", + "322: 2:PT00M50.30S Nerlens Noel (substitution)\n", + "323: 2:PT00M50.30S Jaylen Brown (freethrow)\n", + "324: 2:PT00M39.70S Julius Randle (2pt)\n", + "325: 2:PT00M39.10S (rebound)\n", + "326: 2:PT00M39.10S (stoppage)\n", + "327: 2:PT00M34.80S Jaylen Brown (foul)\n", + "329: 2:PT00M34.80S Julius Randle (freethrow)\n", + "330: 2:PT00M34.80S Julius Randle (freethrow)\n", + "331: 2:PT00M22.20S Marcus Smart (2pt)\n", + "332: 2:PT00M04.30S Elfrid Payton (turnover)\n", + "333: 2:PT00M04.30S Jeff Teague (steal)\n", + "334: 2:PT00M00.40S Jaylen Brown (3pt)\n", + "335: 2:PT00M00.40S Elfrid Payton (block)\n", + "336: 2:PT00M00.40S Reggie Bullock (rebound)\n", + "337: 2:PT00M00.00S (period)\n", + "338: 3:PT12M00.00S Jeff Teague (substitution)\n", + "339: 3:PT12M00.00S Nerlens Noel (substitution)\n", + "340: 3:PT12M00.00S Kemba Walker (substitution)\n", + "341: 3:PT12M00.00S Mitchell Robinson (substitution)\n", + "342: 3:PT12M00.00S (period)\n", + "343: 3:PT11M47.00S Mitchell Robinson (2pt)\n", + "345: 3:PT11M29.00S (stoppage)\n", + "346: 3:PT11M23.00S Kemba Walker (3pt)\n", + "347: 3:PT11M20.00S RJ Barrett (rebound)\n", + "348: 3:PT11M07.00S RJ Barrett (3pt)\n", + "350: 3:PT11M06.00S (timeout)\n", + "351: 3:PT11M06.00S Grant Williams (substitution)\n", + "352: 3:PT11M06.00S Daniel Theis (substitution)\n", + "353: 3:PT10M53.00S Kemba Walker (turnover)\n", + "354: 3:PT10M53.00S Julius Randle (steal)\n", + "355: 3:PT10M49.00S Reggie Bullock (3pt)\n", + "357: 3:PT10M24.00S Marcus Smart (3pt)\n", + "358: 3:PT10M20.00S Julius Randle (rebound)\n", + "359: 3:PT10M07.00S Reggie Bullock (3pt)\n", + "360: 3:PT10M03.00S Kemba Walker (rebound)\n", + "361: 3:PT09M50.00S Marcus Smart (2pt)\n", + "362: 3:PT09M50.00S Mitchell Robinson (block)\n", + "363: 3:PT09M48.00S Reggie Bullock (rebound)\n", + "364: 3:PT09M33.00S RJ Barrett (3pt)\n", + "365: 3:PT09M29.00S Jaylen Brown (rebound)\n", + "366: 3:PT09M24.00S Elfrid Payton (foul)\n", + "368: 3:PT09M19.00S Kemba Walker (3pt)\n", + "369: 3:PT09M15.00S Tristan Thompson (rebound)\n", + "370: 3:PT09M13.00S Kemba Walker (3pt)\n", + "371: 3:PT09M09.00S Julius Randle (rebound)\n", + "372: 3:PT09M01.00S Julius Randle (foul)\n", + "374: 3:PT09M01.00S Julius Randle (turnover)\n", + "375: 3:PT08M47.00S Jaylen Brown (3pt)\n", + "376: 3:PT08M47.00S (rebound)\n", + "377: 3:PT08M47.00S (stoppage)\n", + "378: 3:PT08M33.00S RJ Barrett (2pt)\n", + "379: 3:PT08M30.00S Daniel Theis (rebound)\n", + "380: 3:PT08M25.00S Kemba Walker (2pt)\n", + "381: 3:PT08M21.00S Jaylen Brown (rebound)\n", + "382: 3:PT08M20.00S Jaylen Brown (3pt)\n", + "383: 3:PT08M17.00S Elfrid Payton (rebound)\n", + "384: 3:PT08M10.00S Reggie Bullock (3pt)\n", + "385: 3:PT08M05.00S RJ Barrett (rebound)\n", + "386: 3:PT08M05.00S RJ Barrett (2pt)\n", + "387: 3:PT07M53.00S Marcus Smart (2pt)\n", + "388: 3:PT07M35.00S Mitchell Robinson (2pt)\n", + "390: 3:PT07M24.00S Jaylen Brown (2pt)\n", + "391: 3:PT07M05.00S Julius Randle (2pt)\n", + "393: 3:PT06M54.00S Reggie Bullock (foul)\n", + "395: 3:PT06M54.00S Kemba Walker (freethrow)\n", + "396: 3:PT06M54.00S Kemba Walker (freethrow)\n", + "397: 3:PT06M52.00S Julius Randle (rebound)\n", + "398: 3:PT06M40.00S Elfrid Payton (turnover)\n", + "399: 3:PT06M40.00S Kemba Walker (steal)\n", + "400: 3:PT06M37.00S Marcus Smart (3pt)\n", + "401: 3:PT06M34.00S Tristan Thompson (rebound)\n", + "402: 3:PT06M34.00S Mitchell Robinson (foul)\n", + "404: 3:PT06M34.00S Tristan Thompson (freethrow)\n", + "405: 3:PT06M34.00S (rebound)\n", + "406: 3:PT06M34.00S Mitchell Robinson (substitution)\n", + "407: 3:PT06M34.00S Nerlens Noel (substitution)\n", + "408: 3:PT06M34.00S Tristan Thompson (freethrow)\n", + "409: 3:PT06M20.00S Elfrid Payton (3pt)\n", + "410: 3:PT06M17.00S Tristan Thompson (rebound)\n", + "411: 3:PT06M03.00S Kemba Walker (3pt)\n", + "412: 3:PT06M00.00S Julius Randle (rebound)\n", + "414: 3:PT05M54.00S Marcus Smart (foul)\n", + "416: 3:PT05M54.00S Tristan Thompson (substitution)\n", + "417: 3:PT05M54.00S Semi Ojeleye (substitution)\n", + "418: 3:PT05M41.00S RJ Barrett (2pt)\n", + "419: 3:PT05M39.00S Daniel Theis (rebound)\n", + "420: 3:PT05M32.00S Daniel Theis (3pt)\n", + "422: 3:PT05M23.00S Elfrid Payton (2pt)\n", + "423: 3:PT05M23.00S Daniel Theis (foul)\n", + "425: 3:PT05M23.00S Elfrid Payton (freethrow)\n", + "426: 3:PT05M13.00S Kemba Walker (3pt)\n", + "427: 3:PT05M11.00S RJ Barrett (rebound)\n", + "428: 3:PT04M54.00S RJ Barrett (turnover)\n", + "429: 3:PT04M54.00S Kemba Walker (steal)\n", + "430: 3:PT04M49.00S Jaylen Brown (2pt)\n", + "432: 3:PT04M28.00S Elfrid Payton (2pt)\n", + "435: 3:PT04M11.00S Marcus Smart (2pt)\n", + "436: 3:PT04M09.00S Julius Randle (rebound)\n", + "437: 3:PT03M50.00S Reggie Bullock (turnover)\n", + "438: 3:PT03M50.00S (timeout)\n", + "439: 3:PT03M50.00S Kemba Walker (substitution)\n", + "440: 3:PT03M50.00S RJ Barrett (substitution)\n", + "441: 3:PT03M50.00S Payton Pritchard (substitution)\n", + "442: 3:PT03M50.00S Kevin Knox II (substitution)\n", + "443: 3:PT03M34.00S Daniel Theis (3pt)\n", + "444: 3:PT03M31.00S Payton Pritchard (rebound)\n", + "445: 3:PT03M27.00S Semi Ojeleye (3pt)\n", + "446: 3:PT03M26.00S (rebound)\n", + "447: 3:PT03M26.00S (stoppage)\n", + "448: 3:PT03M16.00S Elfrid Payton (2pt)\n", + "449: 3:PT03M13.00S Marcus Smart (rebound)\n", + "450: 3:PT03M08.00S Jaylen Brown (2pt)\n", + "451: 3:PT03M08.00S Nerlens Noel (block)\n", + "452: 3:PT03M06.00S Julius Randle (rebound)\n", + "453: 3:PT02M45.00S Julius Randle (3pt)\n", + "454: 3:PT02M44.00S Payton Pritchard (rebound)\n", + "455: 3:PT02M26.00S Payton Pritchard (turnover)\n", + "456: 3:PT02M26.00S Elfrid Payton (substitution)\n", + "457: 3:PT02M26.00S Immanuel Quickley (substitution)\n", + "458: 3:PT02M05.00S Julius Randle (2pt)\n", + "459: 3:PT02M05.00S Daniel Theis (foul)\n", + "461: 3:PT02M05.00S Reggie Bullock (substitution)\n", + "462: 3:PT02M05.00S Austin Rivers (substitution)\n", + "463: 3:PT02M05.00S Julius Randle (freethrow)\n", + "464: 3:PT01M53.00S Kevin Knox II (foul)\n", + "466: 3:PT01M53.00S Jaylen Brown (substitution)\n", + "467: 3:PT01M53.00S Marcus Smart (substitution)\n", + "468: 3:PT01M53.00S Aaron Nesmith (substitution)\n", + "469: 3:PT01M53.00S Javonte Green (substitution)\n", + "470: 3:PT01M47.00S Payton Pritchard (3pt)\n", + "471: 3:PT01M44.00S (rebound)\n", + "472: 3:PT01M44.00S (stoppage)\n", + "473: 3:PT01M35.00S Payton Pritchard (turnover)\n", + "474: 3:PT01M35.00S Nerlens Noel (steal)\n", + "475: 3:PT01M30.00S Nerlens Noel (2pt)\n", + "477: 3:PT01M07.00S Immanuel Quickley (foul)\n", + "479: 3:PT01M07.00S Javonte Green (freethrow)\n", + "480: 3:PT01M07.00S (rebound)\n", + "481: 3:PT01M07.00S Semi Ojeleye (substitution)\n", + "482: 3:PT01M07.00S Grant Williams (substitution)\n", + "483: 3:PT01M07.00S Javonte Green (freethrow)\n", + "484: 3:PT00M55.80S Immanuel Quickley (2pt)\n", + "485: 3:PT00M52.40S Daniel Theis (rebound)\n", + "486: 3:PT00M50.70S Payton Pritchard (3pt)\n", + "487: 3:PT00M40.00S Daniel Theis (violation)\n", + "488: 3:PT00M40.00S Julius Randle (substitution)\n", + "489: 3:PT00M40.00S Obi Toppin (substitution)\n", + "490: 3:PT00M39.00S Daniel Theis (foul)\n", + "492: 3:PT00M39.00S (timeout)\n", + "493: 3:PT00M39.00S Daniel Theis (substitution)\n", + "494: 3:PT00M39.00S Jeff Teague (substitution)\n", + "495: 3:PT00M27.60S Obi Toppin (3pt)\n", + "497: 3:PT00M01.60S Aaron Nesmith (3pt)\n", + "498: 3:PT00M01.60S Nerlens Noel (rebound)\n", + "499: 3:PT00M00.00S (period)\n", + "500: 4:PT12M00.00S Aaron Nesmith (substitution)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "501: 4:PT12M00.00S Javonte Green (substitution)\n", + "502: 4:PT12M00.00S Jeff Teague (substitution)\n", + "503: 4:PT12M00.00S Tristan Thompson (substitution)\n", + "504: 4:PT12M00.00S Marcus Smart (substitution)\n", + "505: 4:PT12M00.00S Jaylen Brown (substitution)\n", + "506: 4:PT12M00.00S (period)\n", + "507: 4:PT11M48.00S Tristan Thompson (2pt)\n", + "508: 4:PT11M48.00S Obi Toppin (block)\n", + "509: 4:PT11M47.00S (rebound)\n", + "510: 4:PT11M47.00S (stoppage)\n", + "511: 4:PT11M43.00S Tristan Thompson (foul)\n", + "513: 4:PT11M43.00S Tristan Thompson (turnover)\n", + "514: 4:PT11M32.00S Obi Toppin (2pt)\n", + "516: 4:PT11M19.00S Tristan Thompson (2pt)\n", + "517: 4:PT11M18.00S Jaylen Brown (rebound)\n", + "518: 4:PT11M16.00S Jaylen Brown (2pt)\n", + "560: 4:PT11M06.00S Immanuel Quickley (turnover)\n", + "561: 4:PT11M06.00S Grant Williams (steal)\n", + "562: 4:PT11M06.00S Grant Williams (turnover)\n", + "563: 4:PT11M06.00S Immanuel Quickley (steal)\n", + "519: 4:PT10M56.00S Immanuel Quickley (3pt)\n", + "520: 4:PT10M54.00S Marcus Smart (rebound)\n", + "521: 4:PT10M40.00S Marcus Smart (3pt)\n", + "522: 4:PT10M38.00S (rebound)\n", + "523: 4:PT10M38.00S Nerlens Noel (foul)\n", + "525: 4:PT10M32.00S Austin Rivers (foul)\n", + "527: 4:PT10M32.00S Jaylen Brown (freethrow)\n", + "528: 4:PT10M32.00S Jaylen Brown (freethrow)\n", + "529: 4:PT10M16.00S Obi Toppin (3pt)\n", + "531: 4:PT10M03.00S Marcus Smart (2pt)\n", + "532: 4:PT09M58.00S Payton Pritchard (foul)\n", + "534: 4:PT09M48.00S Austin Rivers (2pt)\n", + "535: 4:PT09M47.00S Payton Pritchard (rebound)\n", + "536: 4:PT09M44.00S Immanuel Quickley (foul)\n", + "538: 4:PT09M35.00S Jaylen Brown (2pt)\n", + "539: 4:PT09M33.00S Tristan Thompson (rebound)\n", + "540: 4:PT09M32.00S Marcus Smart (3pt)\n", + "541: 4:PT09M30.00S (rebound)\n", + "542: 4:PT09M30.00S Nerlens Noel (foul)\n", + "544: 4:PT09M30.00S Nerlens Noel (substitution)\n", + "545: 4:PT09M30.00S Austin Rivers (substitution)\n", + "546: 4:PT09M30.00S Mitchell Robinson (substitution)\n", + "547: 4:PT09M30.00S Reggie Bullock (substitution)\n", + "548: 4:PT09M26.00S Jaylen Brown (3pt)\n", + "549: 4:PT09M22.00S Mitchell Robinson (rebound)\n", + "550: 4:PT09M17.00S Jaylen Brown (foul)\n", + "551: 4:PT09M17.00S Immanuel Quickley (freethrow)\n", + "552: 4:PT09M05.00S Obi Toppin (3pt)\n", + "553: 4:PT09M01.00S Jaylen Brown (rebound)\n", + "554: 4:PT08M58.00S Jaylen Brown (2pt)\n", + "555: 4:PT08M58.00S Reggie Bullock (foul)\n", + "557: 4:PT08M58.00S (timeout)\n", + "559: 4:PT08M58.00S (instantreplay)\n", + "564: 4:PT08M58.00S Payton Pritchard (substitution)\n", + "565: 4:PT08M58.00S Jeff Teague (substitution)\n", + "566: 4:PT08M58.00S Jaylen Brown (freethrow)\n", + "567: 4:PT08M55.00S Obi Toppin (rebound)\n", + "568: 4:PT08M46.00S Kevin Knox II (3pt)\n", + "570: 4:PT08M31.00S Kevin Knox II (foul)\n", + "572: 4:PT08M31.00S Obi Toppin (substitution)\n", + "573: 4:PT08M31.00S Julius Randle (substitution)\n", + "574: 4:PT08M31.00S Marcus Smart (freethrow)\n", + "575: 4:PT08M31.00S Marcus Smart (freethrow)\n", + "576: 4:PT08M30.00S Reggie Bullock (rebound)\n", + "577: 4:PT08M06.00S Julius Randle (3pt)\n", + "579: 4:PT07M49.00S Kevin Knox II (foul)\n", + "581: 4:PT07M49.00S Marcus Smart (freethrow)\n", + "582: 4:PT07M49.00S Kevin Knox II (substitution)\n", + "583: 4:PT07M49.00S RJ Barrett (substitution)\n", + "584: 4:PT07M49.00S Marcus Smart (freethrow)\n", + "585: 4:PT07M49.00S Reggie Bullock (rebound)\n", + "586: 4:PT07M26.00S Julius Randle (turnover)\n", + "587: 4:PT07M26.00S Marcus Smart (steal)\n", + "588: 4:PT07M22.00S Jaylen Brown (2pt)\n", + "590: 4:PT07M08.00S Marcus Smart (foul)\n", + "592: 4:PT06M54.00S (turnover)\n", + "593: 4:PT06M42.00S Jeff Teague (3pt)\n", + "594: 4:PT06M39.00S Julius Randle (rebound)\n", + "595: 4:PT06M33.00S Grant Williams (foul)\n", + "597: 4:PT06M33.00S (timeout)\n", + "598: 4:PT06M33.00S Jaylen Brown (substitution)\n", + "599: 4:PT06M33.00S Tristan Thompson (substitution)\n", + "600: 4:PT06M33.00S Marcus Smart (substitution)\n", + "601: 4:PT06M33.00S Aaron Nesmith (substitution)\n", + "602: 4:PT06M33.00S Javonte Green (substitution)\n", + "603: 4:PT06M33.00S Tremont Waters (substitution)\n", + "604: 4:PT06M26.00S Julius Randle (3pt)\n", + "605: 4:PT06M20.00S Mitchell Robinson (rebound)\n", + "606: 4:PT06M20.00S Mitchell Robinson (2pt)\n", + "607: 4:PT06M10.00S RJ Barrett (foul)\n", + "609: 4:PT06M10.00S Javonte Green (freethrow)\n", + "610: 4:PT06M10.00S Javonte Green (freethrow)\n", + "611: 4:PT05M49.00S Immanuel Quickley (3pt)\n", + "612: 4:PT05M39.00S Tremont Waters (3pt)\n", + "613: 4:PT05M37.00S Javonte Green (rebound)\n", + "614: 4:PT05M34.00S Aaron Nesmith (2pt)\n", + "615: 4:PT05M34.00S Immanuel Quickley (block)\n", + "616: 4:PT05M33.00S (rebound)\n", + "617: 4:PT05M33.00S (stoppage)\n", + "618: 4:PT05M22.00S RJ Barrett (2pt)\n", + "620: 4:PT05M12.00S Javonte Green (3pt)\n", + "621: 4:PT05M10.00S Julius Randle (rebound)\n", + "622: 4:PT04M59.00S Javonte Green (foul)\n", + "624: 4:PT04M59.00S Jeff Teague (substitution)\n", + "625: 4:PT04M59.00S Semi Ojeleye (substitution)\n", + "626: 4:PT04M53.00S Grant Williams (foul)\n", + "628: 4:PT04M53.00S RJ Barrett (freethrow)\n", + "629: 4:PT04M53.00S Mitchell Robinson (substitution)\n", + "630: 4:PT04M53.00S Julius Randle (substitution)\n", + "631: 4:PT04M53.00S Obi Toppin (substitution)\n", + "632: 4:PT04M53.00S Nerlens Noel (substitution)\n", + "633: 4:PT04M53.00S RJ Barrett (freethrow)\n", + "634: 4:PT04M41.00S Grant Williams (3pt)\n", + "635: 4:PT04M38.00S RJ Barrett (rebound)\n", + "636: 4:PT04M16.00S Immanuel Quickley (2pt)\n", + "637: 4:PT04M05.00S Semi Ojeleye (3pt)\n", + "638: 4:PT04M02.00S Obi Toppin (rebound)\n", + "639: 4:PT03M53.00S Reggie Bullock (3pt)\n", + "641: 4:PT03M44.00S Immanuel Quickley (foul)\n", + "643: 4:PT03M44.00S Semi Ojeleye (freethrow)\n", + "644: 4:PT03M44.00S Immanuel Quickley (substitution)\n", + "645: 4:PT03M44.00S RJ Barrett (substitution)\n", + "646: 4:PT03M44.00S Dennis Smith Jr. (substitution)\n", + "647: 4:PT03M44.00S Kevin Knox II (substitution)\n", + "648: 4:PT03M44.00S Semi Ojeleye (freethrow)\n", + "649: 4:PT03M31.00S Grant Williams (foul)\n", + "651: 4:PT03M31.00S Nerlens Noel (freethrow)\n", + "652: 4:PT03M31.00S (rebound)\n", + "653: 4:PT03M31.00S Reggie Bullock (substitution)\n", + "654: 4:PT03M31.00S Theo Pinson (substitution)\n", + "655: 4:PT03M31.00S Nerlens Noel (freethrow)\n", + "656: 4:PT03M21.00S Aaron Nesmith (3pt)\n", + "657: 4:PT03M19.00S Semi Ojeleye (rebound)\n", + "658: 4:PT03M17.00S Theo Pinson (foul)\n", + "660: 4:PT03M17.00S Javonte Green (freethrow)\n", + "661: 4:PT03M17.00S Kevin Knox II (substitution)\n", + "662: 4:PT03M17.00S Ignas Brazdeikis (substitution)\n", + "663: 4:PT03M17.00S Javonte Green (freethrow)\n", + "664: 4:PT03M17.00S Obi Toppin (rebound)\n", + "665: 4:PT03M00.00S Theo Pinson (3pt)\n", + "666: 4:PT02M57.00S Aaron Nesmith (rebound)\n", + "667: 4:PT02M41.00S Javonte Green (2pt)\n", + "669: 4:PT02M27.00S Dennis Smith Jr. (2pt)\n", + "670: 4:PT02M24.00S Tremont Waters (rebound)\n", + "671: 4:PT02M20.00S Theo Pinson (foul)\n", + "673: 4:PT02M20.00S Semi Ojeleye (freethrow)\n", + "674: 4:PT02M20.00S Semi Ojeleye (freethrow)\n", + "675: 4:PT02M04.00S Nerlens Noel (2pt)\n", + "676: 4:PT02M01.00S Javonte Green (rebound)\n", + "677: 4:PT01M54.00S Grant Williams (3pt)\n", + "678: 4:PT01M52.00S Nerlens Noel (rebound)\n", + "679: 4:PT01M38.00S Aaron Nesmith (foul)\n", + "681: 4:PT01M38.00S Dennis Smith Jr. (freethrow)\n", + "682: 4:PT01M38.00S Dennis Smith Jr. (freethrow)\n", + "683: 4:PT01M38.00S Semi Ojeleye (rebound)\n", + "684: 4:PT01M22.00S Aaron Nesmith (2pt)\n", + "685: 4:PT01M22.00S Nerlens Noel (block)\n", + "686: 4:PT01M19.00S Obi Toppin (rebound)\n", + "687: 4:PT01M15.00S Ignas Brazdeikis (turnover)\n", + "688: 4:PT01M15.00S Tremont Waters (steal)\n", + "689: 4:PT01M13.00S Javonte Green (turnover)\n", + "690: 4:PT01M13.00S Obi Toppin (steal)\n", + "691: 4:PT01M12.00S (stoppage)\n", + "692: 4:PT00M56.90S Dennis Smith Jr. (3pt)\n", + "693: 4:PT00M55.20S (rebound)\n", + "694: 4:PT00M55.20S (stoppage)\n", + "695: 4:PT00M49.70S Tremont Waters (3pt)\n", + "696: 4:PT00M35.90S Nerlens Noel (2pt)\n", + "697: 4:PT00M21.20S Nerlens Noel (foul)\n", + "699: 4:PT00M21.20S Grant Williams (freethrow)\n", + "701: 4:PT00M21.20S Grant Williams (freethrow)\n", + "702: 4:PT00M19.70S Nerlens Noel (rebound)\n", + "703: 4:PT00M00.00S (period)\n", + "704: 4:PT00M00.00S (game)\n" + ] + } + ], + "source": [ + "# Query nba.live.endpoints for the score board of GameID 0022000180 = NYK vs BOS\n", + "# Simple PlayByPlay Loop demonstrating data usage\n", + "from nba_api.live.nba.endpoints import playbyplay\n", + "from nba_api.stats.static import players\n", + "\n", + "pbp = playbyplay.PlayByPlay('0022000196')\n", + "line = \"{action_number}: {period}:{clock} {player_id} ({action_type})\"\n", + "actions = pbp.get_dict()['game']['actions'] #plays are referred to in the live data as `actions`\n", + "for action in actions:\n", + " player_name = ''\n", + " player = players.find_player_by_id(action['personId'])\n", + " if player is not None:\n", + " player_name = player['full_name']\n", + " print(line.format(action_number=action['actionNumber'],period=action['period'],clock=action['clock'],action_type=action['actionType'],player_id=player_name))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.1" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/docs/nba_api/live/endpoints/boxscore.md b/docs/nba_api/live/endpoints/boxscore.md new file mode 100644 index 00000000..be415569 --- /dev/null +++ b/docs/nba_api/live/endpoints/boxscore.md @@ -0,0 +1,363 @@ +# BoxScore +##### [nba_api/live/nba/endpoints/boxscore.py](https://github.com/swar/nba_api/blob/master/nba_api/live/nba/endpoints/boxscore.py) + +##### Endpoint URL +>[https://cdn.nba.com/static/json/liveData/boxscore/boxscore_{game_id}.json](https://cdn.nba.com/static/json/liveData/boxscore/boxscore_{game_id}.json) + +##### Valid URL +>[https://cdn.nba.com/static/json/liveData/boxscore/boxscore_0022000181.json](https://cdn.nba.com/static/json/liveData/boxscore/boxscore_0022000181.json) + +## Parameters +API Parameter Name | Python Parameter Variable | Pattern | Required | Nullable +------------ | ------------ | :-----------: | :---: | :---: +[_**GameID**_](https://github.com/swar/nba_api/blob/master/docs/nba_api/stats/library/parameters.md#GameID) | game_id | `^\d{10}$` | `Y` | | + +## DataSets +#### Arena `Arena` +```text +["arenaId", "arenaName", "arenaCity", "arenaState", "arenaCountry", "arenaTimezone"} +``` +#### AwayTeam `away_team` +```text +["teamId", "teamName", "teamCity", "teamTricode", "score", "inBonus", "timeoutsRemaining", "periods"["period", "periodType", "score"], "players"["status", "notPlayingReason", "notPlayingDescription", "order", "personId", "jerseyNum", "starter", "oncourt", "played", "statistics""assists", "blocks", "blocksReceived", "fieldGoalsAttempted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "minus", "minutes", "minutesCalculated", "plus", "plusMinusPoints", "points", "pointsFastBreak", "pointsInThePaint", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsTotal", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "turnovers", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage", "name", "nameI", "firstName", "familyName"], "statistics""assists", "assistsTurnoverRatio", "benchPoints", "biggestLead", "biggestLeadScore", "biggestScoringRun", "biggestScoringRunScore", "blocks", "blocksReceived", "fastBreakPointsAttempted", "fastBreakPointsMade", "fastBreakPointsPercentage", "fieldGoalsAttempted", "fieldGoalsEffectiveAdjusted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTeam", "foulsTechnical", "foulsTeamTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "leadChanges", "minutes", "minutesCalculated", "points", "pointsAgainst", "pointsFastBreak", "pointsFromTurnovers", "pointsInThePaint", "pointsInThePaintAttempted", "pointsInThePaintMade", "pointsInThePaintPercentage", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsPersonal", "reboundsTeam", "reboundsTeamDefensive", "reboundsTeamOffensive", "reboundsTotal", "secondChancePointsAttempted", "secondChancePointsMade", "secondChancePointsPercentage", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "timeLeading", "timesTied", "trueShootingAttempts", "trueShootingPercentage", "turnovers", "turnoversTeam", "turnoversTotal", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage"] +``` +#### AwayTeamStats `away_team_stats` +```text +["teamId", "teamName", "teamCity", "teamTricode", "score", "inBonus", "timeoutsRemaining", "periods"["period", "periodType", "score"], "statistics""assists", "assistsTurnoverRatio", "benchPoints", "biggestLead", "biggestLeadScore", "biggestScoringRun", "biggestScoringRunScore", "blocks", "blocksReceived", "fastBreakPointsAttempted", "fastBreakPointsMade", "fastBreakPointsPercentage", "fieldGoalsAttempted", "fieldGoalsEffectiveAdjusted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTeam", "foulsTechnical", "foulsTeamTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "leadChanges", "minutes", "minutesCalculated", "points", "pointsAgainst", "pointsFastBreak", "pointsFromTurnovers", "pointsInThePaint", "pointsInThePaintAttempted", "pointsInThePaintMade", "pointsInThePaintPercentage", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsPersonal", "reboundsTeam", "reboundsTeamDefensive", "reboundsTeamOffensive", "reboundsTotal", "secondChancePointsAttempted", "secondChancePointsMade", "secondChancePointsPercentage", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "timeLeading", "timesTied", "trueShootingAttempts", "trueShootingPercentage", "turnovers", "turnoversTeam", "turnoversTotal", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage"] +``` +#### AwayTeamPlayerStats `away_team_player_stats` +``` +["status", "notPlayingReason", "notPlayingDescription", "order", "personId", "jerseyNum", "starter", "oncourt", "played", "statistics""assists", "blocks", "blocksReceived", "fieldGoalsAttempted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "minus", "minutes", "minutesCalculated", "plus", "plusMinusPoints", "points", "pointsFastBreak", "pointsInThePaint", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsTotal", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "turnovers", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage", "name", "nameI", "firstName", "familyName"] +``` +#### Game `game` +```text +["gameId", "gameTimeLocal", "gameTimeUTC", "gameTimeHome", "gameTimeAway", "gameEt", "duration", "gameCode", "gameStatusText", "gameStatus", "regulationPeriods", "period", "gameClock", "attendance", "sellout", "arena""arenaId", "arenaName", "arenaCity", "arenaState", "arenaCountry", "arenaTimezone", "officials"["personId", "name", "nameI", "firstName", "familyName", "jerseyNum", "assignment"], "homeTeam" ["teamId", "teamName", "teamCity", "teamTricode", "score", "inBonus", "timeoutsRemaining", "periods"["period", "periodType", "score"], "players"["status", "notPlayingReason", "notPlayingDescription", "order", "personId", "jerseyNum", "starter", "oncourt", "played", "statistics""assists", "blocks", "blocksReceived", "fieldGoalsAttempted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "minus", "minutes", "minutesCalculated", "plus", "plusMinusPoints", "points", "pointsFastBreak", "pointsInThePaint", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsTotal", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "turnovers", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage", "name", "nameI", "firstName", "familyName"], "statistics""assists", "assistsTurnoverRatio", "benchPoints", "biggestLead", "biggestLeadScore", "biggestScoringRun", "biggestScoringRunScore", "blocks", "blocksReceived", "fastBreakPointsAttempted", "fastBreakPointsMade", "fastBreakPointsPercentage", "fieldGoalsAttempted", "fieldGoalsEffectiveAdjusted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTeam", "foulsTechnical", "foulsTeamTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "leadChanges", "minutes", "minutesCalculated", "points", "pointsAgainst", "pointsFastBreak", "pointsFromTurnovers", "pointsInThePaint", "pointsInThePaintAttempted", "pointsInThePaintMade", "pointsInThePaintPercentage", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsPersonal", "reboundsTeam", "reboundsTeamDefensive", "reboundsTeamOffensive", "reboundsTotal", "secondChancePointsAttempted", "secondChancePointsMade", "secondChancePointsPercentage", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "timeLeading", "timesTied", "trueShootingAttempts", "trueShootingPercentage", "turnovers", "turnoversTeam", "turnoversTotal", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage"], "awayTeam"["teamId", "teamName", "teamCity", "teamTricode", "score", "inBonus", "timeoutsRemaining", "periods"["period", "periodType", "score"], "players"["status", "notPlayingReason", "notPlayingDescription", "order", "personId", "jerseyNum", "starter", "oncourt", "played", "statistics""assists", "blocks", "blocksReceived", "fieldGoalsAttempted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "minus", "minutes", "minutesCalculated", "plus", "plusMinusPoints", "points", "pointsFastBreak", "pointsInThePaint", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsTotal", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "turnovers", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage", "name", "nameI", "firstName", "familyName"], "statistics""assists", "assistsTurnoverRatio", "benchPoints", "biggestLead", "biggestLeadScore", "biggestScoringRun", "biggestScoringRunScore", "blocks", "blocksReceived", "fastBreakPointsAttempted", "fastBreakPointsMade", "fastBreakPointsPercentage", "fieldGoalsAttempted", "fieldGoalsEffectiveAdjusted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTeam", "foulsTechnical", "foulsTeamTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "leadChanges", "minutes", "minutesCalculated", "points", "pointsAgainst", "pointsFastBreak", "pointsFromTurnovers", "pointsInThePaint", "pointsInThePaintAttempted", "pointsInThePaintMade", "pointsInThePaintPercentage", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsPersonal", "reboundsTeam", "reboundsTeamDefensive", "reboundsTeamOffensive", "reboundsTotal", "secondChancePointsAttempted", "secondChancePointsMade", "secondChancePointsPercentage", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "timeLeading", "timesTied", "trueShootingAttempts", "trueShootingPercentage", "turnovers", "turnoversTeam", "turnoversTotal", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage"]] +``` +#### HomeTeam `home_team` +```text +["teamId", "teamName", "teamCity", "teamTricode", "score", "inBonus", "timeoutsRemaining", "periods"["period", "periodType", "score"], "players"["status", "notPlayingReason", "notPlayingDescription", "order", "personId", "jerseyNum", "starter", "oncourt", "played", "statistics""assists", "blocks", "blocksReceived", "fieldGoalsAttempted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "minus", "minutes", "minutesCalculated", "plus", "plusMinusPoints", "points", "pointsFastBreak", "pointsInThePaint", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsTotal", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "turnovers", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage", "name", "nameI", "firstName", "familyName"], "statistics""assists", "assistsTurnoverRatio", "benchPoints", "biggestLead", "biggestLeadScore", "biggestScoringRun", "biggestScoringRunScore", "blocks", "blocksReceived", "fastBreakPointsAttempted", "fastBreakPointsMade", "fastBreakPointsPercentage", "fieldGoalsAttempted", "fieldGoalsEffectiveAdjusted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTeam", "foulsTechnical", "foulsTeamTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "leadChanges", "minutes", "minutesCalculated", "points", "pointsAgainst", "pointsFastBreak", "pointsFromTurnovers", "pointsInThePaint", "pointsInThePaintAttempted", "pointsInThePaintMade", "pointsInThePaintPercentage", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsPersonal", "reboundsTeam", "reboundsTeamDefensive", "reboundsTeamOffensive", "reboundsTotal", "secondChancePointsAttempted", "secondChancePointsMade", "secondChancePointsPercentage", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "timeLeading", "timesTied", "trueShootingAttempts", "trueShootingPercentage", "turnovers", "turnoversTeam", "turnoversTotal", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage"] +``` +#### HomeTeamStats `home_team_stats` +```text +["teamId", "teamName", "teamCity", "teamTricode", "score", "inBonus", "timeoutsRemaining", "periods"["period", "periodType", "score"], "statistics""assists", "assistsTurnoverRatio", "benchPoints", "biggestLead", "biggestLeadScore", "biggestScoringRun", "biggestScoringRunScore", "blocks", "blocksReceived", "fastBreakPointsAttempted", "fastBreakPointsMade", "fastBreakPointsPercentage", "fieldGoalsAttempted", "fieldGoalsEffectiveAdjusted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTeam", "foulsTechnical", "foulsTeamTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "leadChanges", "minutes", "minutesCalculated", "points", "pointsAgainst", "pointsFastBreak", "pointsFromTurnovers", "pointsInThePaint", "pointsInThePaintAttempted", "pointsInThePaintMade", "pointsInThePaintPercentage", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsPersonal", "reboundsTeam", "reboundsTeamDefensive", "reboundsTeamOffensive", "reboundsTotal", "secondChancePointsAttempted", "secondChancePointsMade", "secondChancePointsPercentage", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "timeLeading", "timesTied", "trueShootingAttempts", "trueShootingPercentage", "turnovers", "turnoversTeam", "turnoversTotal", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage"] +``` +#### HomeTeamPlayerStats `home_team_player_stats` +``` +["status", "notPlayingReason", "notPlayingDescription", "order", "personId", "jerseyNum", "starter", "oncourt", "played", "statistics""assists", "blocks", "blocksReceived", "fieldGoalsAttempted", "fieldGoalsMade", "fieldGoalsPercentage", "foulsOffensive", "foulsDrawn", "foulsPersonal", "foulsTechnical", "freeThrowsAttempted", "freeThrowsMade", "freeThrowsPercentage", "minus", "minutes", "minutesCalculated", "plus", "plusMinusPoints", "points", "pointsFastBreak", "pointsInThePaint", "pointsSecondChance", "reboundsDefensive", "reboundsOffensive", "reboundsTotal", "steals", "threePointersAttempted", "threePointersMade", "threePointersPercentage", "turnovers", "twoPointersAttempted", "twoPointersMade", "twoPointersPercentage", "name", "nameI", "firstName", "familyName"] +``` +#### Officials `officials` +```text +["personId", "name", "nameI", "firstName", "familyName", "jerseyNum", "assignment"] +``` + + + +## JSON +```json +{ + "meta":{ + "version":1, + "code":200, + "request":"http://nba.cloud/games/0022000180/boxscore?Format=json", + "time":"2021-01-15 23:51:25.282704" + }, + "game":{ + "gameId":"0022000180", + "gameTimeLocal":"2021-01-15T19:30:00-05:00", + "gameTimeUTC":"2021-01-16T00:30:00Z", + "gameTimeHome":"2021-01-15T19:30:00-05:00", + "gameTimeAway":"2021-01-15T19:30:00-05:00", + "gameEt":"2021-01-15T19:30:00-05:00", + "duration":125, + "gameCode":"20210115/ORLBOS", + "gameStatusText":"Final", + "gameStatus":3, + "regulationPeriods":4, + "period":4, + "gameClock":"PT00M00.00S", + "attendance":0, + "sellout":"0", + "arena":{ + "arenaId":17, + "arenaName":"TD Garden", + "arenaCity":"Boston", + "arenaState":"MA", + "arenaCountry":"US", + "arenaTimezone":"America/New_York" + }, + "officials":[ + { + "personId":201638, + "name":"Brent Barnaky", + "nameI":"B. Barnaky", + "firstName":"Brent", + "familyName":"Barnaky", + "jerseyNum":"36", + "assignment":"OFFICIAL1" + } + ], + "homeTeam":{ + "teamId":1610612738, + "teamName":"Celtics", + "teamCity":"Boston", + "teamTricode":"BOS", + "score":124, + "inBonus":"1", + "timeoutsRemaining":2, + "periods":[ + { + "period":1, + "periodType":"REGULAR", + "score":34 + } + ], + "players":[ + { + "status":"ACTIVE", + "order":1, + "personId":1627759, + "jerseyNum":"7", + "position":"SF", + "starter":"1", + "oncourt":"0", + "played":"1", + "statistics":{ + "assists":8, + "blocks":0, + "blocksReceived":0, + "fieldGoalsAttempted":12, + "fieldGoalsMade":6, + "fieldGoalsPercentage":0.5, + "foulsOffensive":0, + "foulsDrawn":4, + "foulsPersonal":1, + "foulsTechnical":0, + "freeThrowsAttempted":7, + "freeThrowsMade":7, + "freeThrowsPercentage":1.0, + "minus":50.0, + "minutes":"PT25M01.00S", + "minutesCalculated":"PT25M", + "plus":65.0, + "plusMinusPoints":15.0, + "points":21, + "pointsFastBreak":0, + "pointsInThePaint":6, + "pointsSecondChance":0, + "reboundsDefensive":2, + "reboundsOffensive":0, + "reboundsTotal":2, + "steals":1, + "threePointersAttempted":5, + "threePointersMade":2, + "threePointersPercentage":0.4, + "turnovers":2, + "twoPointersAttempted":7, + "twoPointersMade":4, + "twoPointersPercentage":0.5714285714285711 + }, + "name":"Jaylen Brown", + "nameI":"J. Brown", + "firstName":"Jaylen", + "familyName":"Brown" + } + ], + "statistics":{ + "assists":25, + "assistsTurnoverRatio":2.27272727272727, + "benchPoints":66, + "biggestLead":29, + "biggestLeadScore":"72-101", + "biggestScoringRun":13, + "biggestScoringRunScore":"72-101", + "blocks":4, + "blocksReceived":1, + "fastBreakPointsAttempted":9, + "fastBreakPointsMade":5, + "fastBreakPointsPercentage":0.555555555555556, + "fieldGoalsAttempted":88, + "fieldGoalsEffectiveAdjusted":0.607954545454545, + "fieldGoalsMade":45, + "fieldGoalsPercentage":0.511363636363636, + "foulsOffensive":0, + "foulsDrawn":16, + "foulsPersonal":18, + "foulsTeam":18, + "foulsTechnical":0, + "foulsTeamTechnical":0, + "freeThrowsAttempted":19, + "freeThrowsMade":17, + "freeThrowsPercentage":0.894736842105263, + "leadChanges":4, + "minutes":"PT240M00.00S", + "minutesCalculated":"PT240M", + "points":124, + "pointsAgainst":97, + "pointsFastBreak":13, + "pointsFromTurnovers":16, + "pointsInThePaint":48, + "pointsInThePaintAttempted":36, + "pointsInThePaintMade":24, + "pointsInThePaintPercentage":0.666666666666666, + "pointsSecondChance":11, + "reboundsDefensive":39, + "reboundsOffensive":6, + "reboundsPersonal":45, + "reboundsTeam":6, + "reboundsTeamDefensive":2, + "reboundsTeamOffensive":4, + "reboundsTotal":51, + "secondChancePointsAttempted":6, + "secondChancePointsMade":4, + "secondChancePointsPercentage":0.666666666666666, + "steals":7, + "threePointersAttempted":42, + "threePointersMade":17, + "threePointersPercentage":0.40476190476190504, + "timeLeading":"PT47M16.00S", + "timesTied":0, + "trueShootingAttempts":96.36, + "trueShootingPercentage":0.6434205064342051, + "turnovers":10, + "turnoversTeam":1, + "turnoversTotal":11, + "twoPointersAttempted":46, + "twoPointersMade":28, + "twoPointersPercentage":0.608695652173913 + } + }, + "awayTeam":{ + "teamId":1610612753, + "teamName":"Magic", + "teamCity":"Orlando", + "teamTricode":"ORL", + "score":97, + "inBonus":"1", + "timeoutsRemaining":2, + "periods":[ + { + "period":1, + "periodType":"REGULAR", + "score":28 + } + ], + "players":[ + { + "status":"ACTIVE", + "order":1, + "personId":203516, + "jerseyNum":"11", + "position":"SF", + "starter":"1", + "oncourt":"0", + "played":"1", + "statistics":{ + "assists":0, + "blocks":0, + "blocksReceived":0, + "fieldGoalsAttempted":4, + "fieldGoalsMade":1, + "fieldGoalsPercentage":0.25, + "foulsOffensive":0, + "foulsDrawn":0, + "foulsPersonal":3, + "foulsTechnical":0, + "freeThrowsAttempted":0, + "freeThrowsMade":0, + "freeThrowsPercentage":0.0, + "minus":41.0, + "minutes":"PT14M34.00S", + "minutesCalculated":"PT14M", + "plus":36.0, + "plusMinusPoints":-5.0, + "points":2, + "pointsFastBreak":0, + "pointsInThePaint":2, + "pointsSecondChance":0, + "reboundsDefensive":1, + "reboundsOffensive":0, + "reboundsTotal":1, + "steals":0, + "threePointersAttempted":2, + "threePointersMade":0, + "threePointersPercentage":0.0, + "turnovers":0, + "twoPointersAttempted":2, + "twoPointersMade":1, + "twoPointersPercentage":0.5 + }, + "name":"James Ennis III", + "nameI":"J. Ennis III", + "firstName":"James", + "familyName":"Ennis III" + } + ], + "statistics":{ + "assists":14, + "assistsTurnoverRatio":1.07692307692308, + "benchPoints":33, + "biggestLead":1, + "biggestLeadScore":"4-3", + "biggestScoringRun":13, + "biggestScoringRunScore":"72-101", + "blocks":1, + "blocksReceived":4, + "fastBreakPointsAttempted":7, + "fastBreakPointsMade":2, + "fastBreakPointsPercentage":0.28571428571428603, + "fieldGoalsAttempted":94, + "fieldGoalsEffectiveAdjusted":0.441489361702128, + "fieldGoalsMade":38, + "fieldGoalsPercentage":0.404255319148936, + "foulsOffensive":2, + "foulsDrawn":18, + "foulsPersonal":16, + "foulsTeam":14, + "foulsTechnical":1, + "foulsTeamTechnical":0, + "freeThrowsAttempted":22, + "freeThrowsMade":14, + "freeThrowsPercentage":0.636363636363636, + "leadChanges":4, + "minutes":"PT240M00.00S", + "minutesCalculated":"PT240M", + "points":97, + "pointsAgainst":124, + "pointsFastBreak":8, + "pointsFromTurnovers":10, + "pointsInThePaint":52, + "pointsInThePaintAttempted":47, + "pointsInThePaintMade":26, + "pointsInThePaintPercentage":0.553191489361702, + "pointsSecondChance":20, + "reboundsDefensive":31, + "reboundsOffensive":15, + "reboundsPersonal":46, + "reboundsTeam":12, + "reboundsTeamDefensive":4, + "reboundsTeamOffensive":8, + "reboundsTotal":58, + "secondChancePointsAttempted":16, + "secondChancePointsMade":9, + "secondChancePointsPercentage":0.5625, + "steals":5, + "threePointersAttempted":28, + "threePointersMade":7, + "threePointersPercentage":0.25, + "timeLeading":"PT00M30.00S", + "timesTied":0, + "trueShootingAttempts":103.68, + "trueShootingPercentage":0.46778549382716, + "turnovers":11, + "turnoversTeam":2, + "turnoversTotal":13, + "twoPointersAttempted":66, + "twoPointersMade":31, + "twoPointersPercentage":0.46969696969696995 + } + } + } +} +``` + +Last validated 2020-08-16 \ No newline at end of file diff --git a/docs/nba_api/live/endpoints/playbyplay.md b/docs/nba_api/live/endpoints/playbyplay.md new file mode 100644 index 00000000..ae974e39 --- /dev/null +++ b/docs/nba_api/live/endpoints/playbyplay.md @@ -0,0 +1,158 @@ +# PlayByPlay +##### [nba_api/live/nba/endpoints/playbyplay.py](https://github.com/swar/nba_api/blob/master/nba_api/live/nba/endpoints/playbyplay.py) + +##### Endpoint URL +>>[https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_{game_id}.json](playbyplay/playbyplay_{game_id}.json) + +##### Valid URL +>>[https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_0022000180.json](https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_0022000180.json) + +## Parameters +API Parameter Name | Python Parameter Variable | Pattern | Required | Nullable +------------ | ------------ | :-----------: | :---: | :---: +[_**GameID**_](https://github.com/swar/nba_api/blob/master/docs/nba_api/stats/library/parameters.md#GameID) | game_id | `^\d{10}$` | `Y` | | + +## Data Sets +#### Actions `actions` +```text +["actionNumber", "actionType", "assistPersonId", "assistPlayerNameInitial", "assistTotal", "blockPersonId", "blockPlayerName", "clock", "description", "descriptor", "edited", "foulDrawnPersonId", "foulDrawnPlayerName", "foulPersonalTotal", "foulTechnicalTotal", "isFieldGoal", "jumpBallLostPersonId", "jumpBallLostPlayerName", "jumpBallRecoverdPersonId", "jumpBallRecoveredName", "jumpBallWonPersonId", "jumpBallWonPlayerName", "officialId", "orderNumber", "period", "periodType", "personId", "personIdsFilter"[], "playerName", "playerNameI", "pointsTotal", "possession", "qualifiers"[], "reboundDefensiveTotal", "reboundOffensiveTotal", "reboundTotal", "scoreAway", "scoreHome", "shotActionNumber", "shotDistance", "shotResult", "side", "stealPersonId", "stealPlayerName", "subType", "teamId", "teamTricode", "timeActual", "turnoverTotal", "value", "x", "xLegacy", "y", "yLegacy"] +``` +## About `Actions` Data Set +This is intended to be a comprehensive list of all possible `actions` available. Note that not all keys appear on every `action` as it depends on the `actionType` +Key | Class | Sample | Description | AlwaysPresent | +------------ | ------------ | :-----------: | :------------------: | :---------: +`actionNumber`|``| `4` | `actionNumber is guaranteed to be sequential but not consectutive ([2, 5, 6, 7, 9, 10])` | `Yes` | +`actionType`|``| `"period"` | `-` | `Yes` | +`assistPersonId`|``| `1627759` | `-` | `No` | +`assistPlayerNameInitial`|``| `J. Brown` | `-` | `No` | +`assistTotal`|``| `3` | `-` | `No` | +`blockPersonId`|``| `1627759` | `-` | `No` | +`blockPlayerName`|``| `J. Brown` | `-` | `No` | +`clock`|``| `PT03M59.00S` | `clock is the Period Time in which the play occurred` | `Yes` | +`description`|``| `J. Brown 14' pullup Jump Shot (2 PTS)` | `description of the action` | `No` | +`descriptor`|``| `pullup` | `a key phrase with regards to the play. Examples: ("heldball","technical","pullup","bad pass","driving finger roll"` ) | `No` | +`edited`|``| `2021-01-16T02:01:02Z` | `The time in which the play was edited` | `No` | +`foulDrawnPersonId`|``| `1627759` | `-` | `No` | +`foulDrawnPlayerName`|``| `Brown` | `-` | `No` | +`foulPersonalTotal`|``| `1` | `-` | `No` | +`foulTechnicalTotal`|``| `0` | `-` | `No` | +`isFieldGoal`|``| `0` | `0 | 1` | `Yes` | +`jumpBallLostPersonId`|``| `203935` | `-` | `No` | +`jumpBallLostPlayerName`|``| `Smart` | `-` | `No` | +`jumpBallRecoverdPersonId`|``| `203932` | `-` | `No` | +`jumpBallRecoveredName`|``| `A. Gordon` | `-` | `No` | +`jumpBallWonPersonId`|``| `203920` | `-` | `No` | +`jumpBallWonPlayerName`|``| `Birch` | `-` | `No` | +`officialId`|``| `-` | `-` | `No` | +`orderNumber`|``| `4560000` | `unknown consecutive number` | `Yes` | +`period`|``| `3` | `-` | `Yes` | +`periodType`|``| `-` | `-` | `Yes` | +`personId`|``| `1629109` | `-` | `Yes` | +`personIdsFilter`|``| `[203932, 203920, 203935]` | `players involved in the play. In this case ti was a jump ball (recovered, won, lost)` | `Yes` | +`playerName`|``| `Clark` | `-` | `No` | +`playerNameI`|``| `G. Clark` | `-` | `No` | +`pointsTotal`|``| `6` | `-` | `No` | +`possession`|``| `1610612753` | `The teamId who has possession` | `Yes` | +`qualifiers`|``| `["pointsinthepaint"]` | `-` | `yes` | +`reboundDefensiveTotal`|``| `6` | `-` | `No` | +`reboundOffensiveTotal`|``| `2` | `-` | `No` | +`reboundTotal`|``| `8` | `-` | `No` | +`scoreAway`|``| `68` | `-` | `Yes` | +`scoreHome`|``| `83` | `-` | `Yes` | +`shotActionNumber`|``| `10` | `shotActionNumber is guaranteed to be sequential but not consectutive ([10, 14, 18, 38])` | +`shotDistance`|``| `4.44` | `-` | `No` | +`shotResult`|``| `"Made" | "Missed"` | `-` | `No` | +`side`|``| `null | "left" | "right"` | `-` | `Yes` | +`stealPersonId`|``| `1629750` | `-` | `No` | +`stealPlayerName`|``| `Green` | `-` | `No` | +`subType`|``| `"request` | `subType of the actonType` | `No` | +`teamId`|``| `1610612738` | `-` | `No` | +`teamTricode`|``| `BOS` | `-` | `No` | +`timeActual`|``| `2021-01-16T02:14:17.3Z` | `The time in which the play occurred` | `Yes` | +`turnoverTotal`|``| `1` | `-` | `No` | +`value`|``| `"Corrected to Offensive Foul on C. Anthony"` | `Was found to be present on an actionType of "instantreplay" and subType of "challenge" with a descriptor of "overturned"` | `No` | +`x`|``| `90.22667542706965` | `-` | `Yes` | +`xLegacy`|``| `-20` | `-` | `Yes` | +`y`|``| `45.90226715686275` | `-` | `Yes` | +`yLegacy`|``| `39` | `-` | `Yes` | + + +## JSON +```json +{ + "meta":{ + "version":1, + "code":200, + "request":"http://nba.cloud/games/0022000180/playbyplay?Format=json", + "time":"2021-01-15 23:48:58.906160" + }, + "game":{ + "gameId":"0022000180", + "actions":[ + { + "actionNumber":2, + "actionType":"period", + "assistPersonId":1627759, + "assistPlayerNameInitial":"J. Brown", + "assistTotal":1, + "blockPersonId":1630202, + "blockPlayerName":"Pritchard", + "clock":"PT10M53.00S", + "description":"N. Vucevic 14' turnaround Hook (2 PTS) (A. Gordon 1 AST)", + "descriptor":"turnaround", + "edited":"2021-01-16T00:42:13Z", + "foulDrawnPersonId":201952, + "foulDrawnPlayerName":"Teague", + "foulPersonalTotal":1, + "foulTechnicalTotal":0, + "isFieldGoal":1, + "jumpBallLostPersonId":1628407, + "jumpBallLostPlayerName":"Bacon", + "jumpBallRecoverdPersonId":1630202, + "jumpBallRecoveredName":"P. Pritchard", + "jumpBallWonPersonId":202684, + "jumpBallWonPlayerName":"Thompson", + "officialId":202041, + "orderNumber":20000, + "period":1, + "periodType":"REGULAR", + "personId":202696, + "personIdsFilter":[ + 1630175, + 201952 + ], + "playerName":"Williams", + "playerNameI":"G. Williams", + "pointsTotal":8, + "possession":1610612753, + "qualifiers":[ + "pointsinthepaint" + ], + "reboundDefensiveTotal":4, + "reboundOffensiveTotal":3, + "reboundTotal":7, + "scoreAway":"68", + "scoreHome":"72", + "shotActionNumber":40, + "shotDistance":10.64, + "shotResult":"Missed", + "side":"right", + "stealPersonId":"202696", + "stealPlayerName":"Vucevic", + "subType":"out", + "teamId":1610612738, + "teamTricode":"BOS", + "timeActual":"2021-01-16T01:16:36.7Z", + "turnoverTotal":2, + "value":"Corrected to Offensive Foul on C. Anthony", + "x":80.81471747700394, + "xLegacy":-63, + "y":37.31234681372549, + "yLegacy":128 + } + ] + } +} +``` + +Last validated 2020-08-16 \ No newline at end of file diff --git a/docs/nba_api/live/endpoints/scoreboard.md b/docs/nba_api/live/endpoints/scoreboard.md new file mode 100644 index 00000000..6a6f2acf --- /dev/null +++ b/docs/nba_api/live/endpoints/scoreboard.md @@ -0,0 +1,124 @@ +# ScoreBoard +##### [nba_api/live/nba/endpoints/scoreboard.py](https://github.com/swar/nba_api/blob/master/nba_api/live/nba/endpoints/scoreboard.py) + +##### Endpoint URL +>[https://cdn.nba.com/static/json/liveData/scoreboard/todaysScoreboard_00.json](https://cdn.nba.com/static/json/liveData/scoreboard/todaysScoreboard_00.json) + +## Parameters +`None` + +## Properties +#### GameDate `game_date` +```text +#returns a string +scoreboard.ScoreBoard().game_date +``` + +#### Games `games` +```text +#returns all games as dictionary +scoreboard.ScoreBoard().games.get_dict() + +#returns all games as json +scoreboard.ScoreBoard().games.get_json() +``` + + +## JSON +```json +{ + "meta":{ + "version":1, + "request":"https://nba-prod-us-east-1-mediaops-stats.s3.amazonaws.com/NBA/liveData/scoreboard/todaysScoreboard_00.json", + "time":"2021-01-16 11:11:39.1139", + "code":200 + }, + "scoreboard":{ + "gameDate":"2021-01-15", + "leagueId":"00", + "leagueName":"National Basketball Association", + "games":[ + { + "gameId":"0022000181", + "gameCode":"20210115/NYKCLE", + "gameStatus":3, + "gameStatusText":"Final", + "period":4, + "gameClock":"", + "gameTimeUTC":"2021-01-16T00:30:00Z", + "gameEt":"2021-01-15T19:30:00Z", + "regulationPeriods":4, + "seriesGameNumber":"", + "seriesText":"", + "homeTeam":{ + "teamId":1610612739, + "teamName":"Cavaliers", + "teamCity":"Cleveland", + "teamTricode":"CLE", + "wins":6, + "losses":7, + "score":106, + "inBonus":"None", + "timeoutsRemaining":1, + "periods":[ + { + "period":1, + "periodType":"REGULAR", + "score":28 + } + ] + }, + "awayTeam":{ + "teamId":1610612752, + "teamName":"Knicks", + "teamCity":"New York", + "teamTricode":"NYK", + "wins":5, + "losses":8, + "score":103, + "inBonus":"None", + "timeoutsRemaining":0, + "periods":[ + { + "period":1, + "periodType":"REGULAR", + "score":25 + } + ] + }, + "gameLeaders":{ + "homeLeaders":{ + "personId":203083, + "name":"Andre Drummond", + "jerseyNum":"3", + "position":"C", + "teamTricode":"CLE", + "playerSlug":"None", + "points":33, + "rebounds":23, + "assists":3 + }, + "awayLeaders":{ + "personId":203944, + "name":"Julius Randle", + "jerseyNum":"30", + "position":"F-C", + "teamTricode":"NYK", + "playerSlug":"None", + "points":28, + "rebounds":6, + "assists":6 + } + }, + "pbOdds":{ + "team":"None", + "odds":0.0, + "suspended":1 + } + } + ] + } +} +``` + +Last validated 2020-08-16 \ No newline at end of file diff --git a/nba_api/live/__init__.py b/nba_api/live/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/nba_api/live/__init__.py @@ -0,0 +1 @@ + diff --git a/nba_api/live/nba/__init__.py b/nba_api/live/nba/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/nba_api/live/nba/endpoints/__init__.py b/nba_api/live/nba/endpoints/__init__.py new file mode 100644 index 00000000..55361759 --- /dev/null +++ b/nba_api/live/nba/endpoints/__init__.py @@ -0,0 +1,10 @@ +__all__ = [ + 'playbyplay', + 'boxscore', + 'scoreboard' +] + +from .playbyplay import PlayByPlay +from .boxscore import BoxScore +from .scoreboard import ScoreBoard + diff --git a/nba_api/live/nba/endpoints/_base.py b/nba_api/live/nba/endpoints/_base.py new file mode 100644 index 00000000..cd6e0d50 --- /dev/null +++ b/nba_api/live/nba/endpoints/_base.py @@ -0,0 +1,29 @@ +import json + + +class Endpoint: + + class DataSet: + key = None + data = {} + + def __init__(self, data={}): + self.data = data + + def get_json(self): + return json.dumps(self.data) + + def get_dict(self): + return self.data + + def get_request_url(self): + return self.nba_response.get_url() + + def get_response(self): + return self.nba_response.get_response() + + def get_dict(self): + return self.nba_response.get_dict() + + def get_json(self): + return self.nba_response.get_json() diff --git a/nba_api/live/nba/endpoints/boxscore.py b/nba_api/live/nba/endpoints/boxscore.py new file mode 100644 index 00000000..cfc2222f --- /dev/null +++ b/nba_api/live/nba/endpoints/boxscore.py @@ -0,0 +1,80 @@ +from nba_api.live.nba.endpoints._base import Endpoint +from nba_api.live.nba.library.http import NBALiveHTTP +class BoxScore(Endpoint): + endpoint_url = 'boxscore/boxscore_{game_id}.json' + expected_data = {'meta': {'version': 1, 'code': 200, 'request': 'http://nba.cloud/games/0022000180/boxscore?Format=json', 'time': '2021-01-15 23:51:25.282704'}, 'game': {'gameId': '0022000180', 'gameTimeLocal': '2021-01-15T19:30:00-05:00', 'gameTimeUTC': '2021-01-16T00:30:00Z', 'gameTimeHome': '2021-01-15T19:30:00-05:00', 'gameTimeAway': '2021-01-15T19:30:00-05:00', 'gameEt': '2021-01-15T19:30:00-05:00', 'duration': 125, 'gameCode': '20210115/ORLBOS', 'gameStatusText': 'Final', 'gameStatus': 3, 'regulationPeriods': 4, 'period': 4, 'gameClock': 'PT00M00.00S', 'attendance': 0, 'sellout': '0', 'arena': {'arenaId': 17, 'arenaName': 'TD Garden', 'arenaCity': 'Boston', 'arenaState': 'MA', 'arenaCountry': 'US', 'arenaTimezone': 'America/New_York'}, 'officials': [{'personId': 201638, 'name': 'Brent Barnaky', 'nameI': 'B. Barnaky', 'firstName': 'Brent', 'familyName': 'Barnaky', 'jerseyNum': '36', 'assignment': 'OFFICIAL1'}], 'homeTeam': {'teamId': 1610612738, 'teamName': 'Celtics', 'teamCity': 'Boston', 'teamTricode': 'BOS', 'score': 124, 'inBonus': '1', 'timeoutsRemaining': 2, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 34}], 'players': [{'status': 'ACTIVE', 'order': 1, 'personId': 1627759, 'jerseyNum': '7', 'position': 'SF', 'starter': '1', 'oncourt': '0', 'played': '1', 'statistics': {'assists': 8, 'blocks': 0, 'blocksReceived': 0, 'fieldGoalsAttempted': 12, 'fieldGoalsMade': 6, 'fieldGoalsPercentage': 0.5, 'foulsOffensive': 0, 'foulsDrawn': 4, 'foulsPersonal': 1, 'foulsTechnical': 0, 'freeThrowsAttempted': 7, 'freeThrowsMade': 7, 'freeThrowsPercentage': 1.0, 'minus': 50.0, 'minutes': 'PT25M01.00S', 'minutesCalculated': 'PT25M', 'plus': 65.0, 'plusMinusPoints': 15.0, 'points': 21, 'pointsFastBreak': 0, 'pointsInThePaint': 6, 'pointsSecondChance': 0, 'reboundsDefensive': 2, 'reboundsOffensive': 0, 'reboundsTotal': 2, 'steals': 1, 'threePointersAttempted': 5, 'threePointersMade': 2, 'threePointersPercentage': 0.4, 'turnovers': 2, 'twoPointersAttempted': 7, 'twoPointersMade': 4, 'twoPointersPercentage': 0.5714285714285711}, 'name': 'Jaylen Brown', 'nameI': 'J. Brown', 'firstName': 'Jaylen', 'familyName': 'Brown'}], 'statistics': {'assists': 25, 'assistsTurnoverRatio': 2.27272727272727, 'benchPoints': 66, 'biggestLead': 29, 'biggestLeadScore': '72-101', 'biggestScoringRun': 13, 'biggestScoringRunScore': '72-101', 'blocks': 4, 'blocksReceived': 1, 'fastBreakPointsAttempted': 9, 'fastBreakPointsMade': 5, 'fastBreakPointsPercentage': 0.555555555555556, 'fieldGoalsAttempted': 88, 'fieldGoalsEffectiveAdjusted': 0.607954545454545, 'fieldGoalsMade': 45, 'fieldGoalsPercentage': 0.511363636363636, 'foulsOffensive': 0, 'foulsDrawn': 16, 'foulsPersonal': 18, 'foulsTeam': 18, 'foulsTechnical': 0, 'foulsTeamTechnical': 0, 'freeThrowsAttempted': 19, 'freeThrowsMade': 17, 'freeThrowsPercentage': 0.894736842105263, 'leadChanges': 4, 'minutes': 'PT240M00.00S', 'minutesCalculated': 'PT240M', 'points': 124, 'pointsAgainst': 97, 'pointsFastBreak': 13, 'pointsFromTurnovers': 16, 'pointsInThePaint': 48, 'pointsInThePaintAttempted': 36, 'pointsInThePaintMade': 24, 'pointsInThePaintPercentage': 0.666666666666666, 'pointsSecondChance': 11, 'reboundsDefensive': 39, 'reboundsOffensive': 6, 'reboundsPersonal': 45, 'reboundsTeam': 6, 'reboundsTeamDefensive': 2, 'reboundsTeamOffensive': 4, 'reboundsTotal': 51, 'secondChancePointsAttempted': 6, 'secondChancePointsMade': 4, 'secondChancePointsPercentage': 0.666666666666666, 'steals': 7, 'threePointersAttempted': 42, 'threePointersMade': 17, 'threePointersPercentage': 0.40476190476190504, 'timeLeading': 'PT47M16.00S', 'timesTied': 0, 'trueShootingAttempts': 96.36, 'trueShootingPercentage': 0.6434205064342051, 'turnovers': 10, 'turnoversTeam': 1, 'turnoversTotal': 11, 'twoPointersAttempted': 46, 'twoPointersMade': 28, 'twoPointersPercentage': 0.608695652173913}}, 'awayTeam': {'teamId': 1610612753, 'teamName': 'Magic', 'teamCity': 'Orlando', 'teamTricode': 'ORL', 'score': 97, 'inBonus': '1', 'timeoutsRemaining': 2, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 28}], 'players': [{'status': 'ACTIVE', 'order': 1, 'personId': 203516, 'jerseyNum': '11', 'position': 'SF', 'starter': '1', 'oncourt': '0', 'played': '1', 'statistics': {'assists': 0, 'blocks': 0, 'blocksReceived': 0, 'fieldGoalsAttempted': 4, 'fieldGoalsMade': 1, 'fieldGoalsPercentage': 0.25, 'foulsOffensive': 0, 'foulsDrawn': 0, 'foulsPersonal': 3, 'foulsTechnical': 0, 'freeThrowsAttempted': 0, 'freeThrowsMade': 0, 'freeThrowsPercentage': 0.0, 'minus': 41.0, 'minutes': 'PT14M34.00S', 'minutesCalculated': 'PT14M', 'plus': 36.0, 'plusMinusPoints': -5.0, 'points': 2, 'pointsFastBreak': 0, 'pointsInThePaint': 2, 'pointsSecondChance': 0, 'reboundsDefensive': 1, 'reboundsOffensive': 0, 'reboundsTotal': 1, 'steals': 0, 'threePointersAttempted': 2, 'threePointersMade': 0, 'threePointersPercentage': 0.0, 'turnovers': 0, 'twoPointersAttempted': 2, 'twoPointersMade': 1, 'twoPointersPercentage': 0.5}, 'name': 'James Ennis III', 'nameI': 'J. Ennis III', 'firstName': 'James', 'familyName': 'Ennis III'}], 'statistics': {'assists': 14, 'assistsTurnoverRatio': 1.07692307692308, 'benchPoints': 33, 'biggestLead': 1, 'biggestLeadScore': '4-3', 'biggestScoringRun': 13, 'biggestScoringRunScore': '72-101', 'blocks': 1, 'blocksReceived': 4, 'fastBreakPointsAttempted': 7, 'fastBreakPointsMade': 2, 'fastBreakPointsPercentage': 0.28571428571428603, 'fieldGoalsAttempted': 94, 'fieldGoalsEffectiveAdjusted': 0.441489361702128, 'fieldGoalsMade': 38, 'fieldGoalsPercentage': 0.404255319148936, 'foulsOffensive': 2, 'foulsDrawn': 18, 'foulsPersonal': 16, 'foulsTeam': 14, 'foulsTechnical': 1, 'foulsTeamTechnical': 0, 'freeThrowsAttempted': 22, 'freeThrowsMade': 14, 'freeThrowsPercentage': 0.636363636363636, 'leadChanges': 4, 'minutes': 'PT240M00.00S', 'minutesCalculated': 'PT240M', 'points': 97, 'pointsAgainst': 124, 'pointsFastBreak': 8, 'pointsFromTurnovers': 10, 'pointsInThePaint': 52, 'pointsInThePaintAttempted': 47, 'pointsInThePaintMade': 26, 'pointsInThePaintPercentage': 0.553191489361702, 'pointsSecondChance': 20, 'reboundsDefensive': 31, 'reboundsOffensive': 15, 'reboundsPersonal': 46, 'reboundsTeam': 12, 'reboundsTeamDefensive': 4, 'reboundsTeamOffensive': 8, 'reboundsTotal': 58, 'secondChancePointsAttempted': 16, 'secondChancePointsMade': 9, 'secondChancePointsPercentage': 0.5625, 'steals': 5, 'threePointersAttempted': 28, 'threePointersMade': 7, 'threePointersPercentage': 0.25, 'timeLeading': 'PT00M30.00S', 'timesTied': 0, 'trueShootingAttempts': 103.68, 'trueShootingPercentage': 0.46778549382716, 'turnovers': 11, 'turnoversTeam': 2, 'turnoversTotal': 13, 'twoPointersAttempted': 66, 'twoPointersMade': 31, 'twoPointersPercentage': 0.46969696969696995}}}} + + arena = None + away_team = None + away_team_player_stats = None + away_team_stats = None + data_sets = None + headers = None + home_team = None + home_team_player_stats = None + home_team_stats = None + game = None + game_details = None + nba_response = None + officials = None + + def __init__(self, + game_id, + proxy=None, + headers=None, + timeout=30, + get_request=True): + self.game_id = game_id + self.proxy = proxy + if headers is not None: + self.headers = headers + self.timeout = timeout + if get_request: + self.get_request() + + def get_request(self): + self.nba_response = NBALiveHTTP().send_api_request( + endpoint=self.endpoint_url.format(game_id=self.game_id), + parameters = {}, + proxy=self.proxy, + headers=self.headers, + timeout=self.timeout + ) + self.load_response() + + def load_response(self): + data_sets = self.nba_response.get_dict() + if 'game' in data_sets: + self.game = Endpoint.DataSet(data=data_sets['game']) + self.game_details = self.game.get_dict().copy() + if 'arena' in self.game.get_dict(): + self.arena = Endpoint.DataSet(data=data_sets['game']['arena']) + self.game_details.pop('arena') + if 'officials' in self.game.get_dict(): + self.officials = Endpoint.DataSet(data=data_sets['game']['officials']) + self.game_details.pop('officials') + if 'homeTeam' in self.game.get_dict(): + self.home_team = Endpoint.DataSet(data=data_sets['game']['homeTeam']) + + #Home Team Player Stats + self.home_team_player_stats = Endpoint.DataSet(data=data_sets['game']['homeTeam']['players']) + + #Home Team Stats + home_team_stats = self.home_team.get_dict().copy() + home_team_stats.pop('players') + self.home_team_stats = Endpoint.DataSet(data=home_team_stats) + + self.game_details.pop('homeTeam') + if 'awayTeam' in self.game.get_dict(): + self.away_team = Endpoint.DataSet(data=data_sets['game']['awayTeam']) + + #Away Team Player Stats + self.away_team_player_stats = Endpoint.DataSet(data=data_sets['game']['awayTeam']['players']) + + #Away Team Stats + away_team_stats = self.away_team.get_dict().copy() + away_team_stats.pop('players') + self.away_team_stats = Endpoint.DataSet(data=away_team_stats) + + self.game_details.pop('awayTeam') + self.game_details = Endpoint.DataSet(data=self.game_details) \ No newline at end of file diff --git a/nba_api/live/nba/endpoints/playbyplay.py b/nba_api/live/nba/endpoints/playbyplay.py new file mode 100644 index 00000000..e5dba3c1 --- /dev/null +++ b/nba_api/live/nba/endpoints/playbyplay.py @@ -0,0 +1,47 @@ +from nba_api.live.nba.endpoints._base import Endpoint +from nba_api.live.nba.library.http import NBALiveHTTP + +class PlayByPlay(Endpoint): + endpoint_url = 'playbyplay/playbyplay_{game_id}.json' + expected_data = {'meta': {'version': 1, 'code': 200, 'request': 'http://nba.cloud/games/0022000180/playbyplay?Format=json', 'time': '2021-01-15 23:48:58.906160'}, 'game': {'gameId': '0022000180', 'actions': [{'actionNumber': 4, 'clock': 'PT11M58.00S', 'timeActual': '2021-01-16T00:40:31.3Z', 'period': 1, 'periodType': 'REGULAR', 'teamId': 1610612738, 'teamTricode': 'BOS', 'actionType': 'jumpball', 'subType': 'recovered', 'descriptor': 'startperiod', 'qualifiers': [], 'personId': 1629684, 'x': None, 'y': None, 'possession': 1610612738, 'scoreHome': '0', 'scoreAway': '0', 'edited': '2021-01-16T00:40:31Z', 'orderNumber': 40000, 'xLegacy': None, 'yLegacy': None, 'isFieldGoal': 0, 'jumpBallRecoveredName': 'G. Williams', 'jumpBallRecoverdPersonId': 1629684, 'side': None, 'playerName': 'Williams', 'playerNameI': 'G. Williams', 'personIdsFilter': [1629684, 202684, 202696], 'jumpBallWonPlayerName': 'Thompson', 'jumpBallWonPersonId': 202684, 'description': 'Jump Ball T. Thompson vs. N. Vucevic: Tip to G. Williams', 'jumpBallLostPlayerName': 'Vucevic', 'jumpBallLostPersonId': 202696}]}} + + #Data Sets + game = Endpoint.DataSet + officials = Endpoint.DataSet + home_team = Endpoint.DataSet + away_team = Endpoint.DataSet + + nba_response = None + data_sets = None + player_stats = None + team_stats = None + headers = None + + def __init__(self, + game_id, + proxy=None, + headers=None, + timeout=30, + get_request=True): + self.game_id = game_id + self.proxy = proxy + if headers is not None: + self.headers = headers + self.timeout = timeout + if get_request: + self.get_request() + + def get_request(self): + self.nba_response = NBALiveHTTP().send_api_request( + endpoint=self.endpoint_url.format(game_id=self.game_id), + parameters = {}, + proxy=self.proxy, + headers=self.headers, + timeout=self.timeout + ) + self.load_response() + + def load_response(self): + data_sets = self.nba_response.get_dict() + if 'game' in data_sets and 'actions' in data_sets['game']: + self.actions = Endpoint.DataSet(data=data_sets['game']['actions']) diff --git a/nba_api/live/nba/endpoints/scoreboard.py b/nba_api/live/nba/endpoints/scoreboard.py new file mode 100644 index 00000000..3b46455d --- /dev/null +++ b/nba_api/live/nba/endpoints/scoreboard.py @@ -0,0 +1,42 @@ +from nba_api.live.nba.endpoints._base import Endpoint +from nba_api.live.nba.library.http import NBALiveHTTP + +class ScoreBoard(Endpoint): + endpoint_url = 'scoreboard/todaysScoreboard_00.json' + expected_data = {'meta': {'version': 0, 'request': '', 'time': '', 'code': 0}, 'scoreboard': {'gameDate': '', 'leagueId': '', 'leagueName': '', 'games': [{'gameId': '', 'gameCode': '', 'gameStatus': 0, 'gameStatusText': '', 'period': 0, 'gameClock': '', 'gameTimeUTC': '', 'gameEt': '', 'regulationPeriods': 0, 'seriesGameNumber': '', 'seriesText': '', 'homeTeam': {'teamId': 0, 'teamName': '', 'teamCity': '', 'teamTricode': '', 'wins': 0, 'losses': 0, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 0, 'periodType': '', 'score': 0}]}, 'awayTeam': {'teamId': 0, 'teamName': '', 'teamCity': '', 'teamTricode': '', 'wins': 0, 'losses': 0, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 0, 'periodType': '', 'score': 0}]}, 'gameLeaders': {'homeLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': '', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}, 'awayLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': '', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}}, 'pbOdds': {'team': None, 'odds': 0.0, 'suspended': 0}}]}} + + nba_response = None + data_sets = None + score_board_date = None + games = None + headers = None + + def __init__(self, + proxy=None, + headers=None, + timeout=30, + get_request=True): + self.proxy = proxy + if headers is not None: + self.headers = headers + self.timeout = timeout + if get_request: + self.get_request() + + def get_request(self): + self.nba_response = NBALiveHTTP().send_api_request( + endpoint=self.endpoint_url, + parameters = {}, + proxy=self.proxy, + headers=self.headers, + timeout=self.timeout + ) + self.load_response() + + def load_response(self): + data_sets = self.nba_response.get_dict() + if 'scoreboard' in data_sets: + self.score_board_date = data_sets['scoreboard']['gameDate'] + if 'games' in data_sets['scoreboard']: + self.games = Endpoint.DataSet(data=data_sets['scoreboard']['games']) + \ No newline at end of file diff --git a/nba_api/live/nba/library/__init__.py b/nba_api/live/nba/library/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/nba_api/live/nba/library/http.py b/nba_api/live/nba/library/http.py new file mode 100644 index 00000000..cd5ad7de --- /dev/null +++ b/nba_api/live/nba/library/http.py @@ -0,0 +1,27 @@ +from nba_api.library import http + + +try: + from nba_api.library.debug.debug import STATS_HEADERS +except ImportError: + STATS_HEADERS = { + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'Accept-Encoding': 'gzip, deflate, br', + 'Accept-Language': 'en-US,en;q=0.9', + 'Cache-Control': 'max-age=0', + 'Connection': 'keep-alive', + 'Host': 'cdn.nba.com', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + } + + +class NBALiveHTTP(http.NBAHTTP): + + nba_response = http.NBAResponse + base_url = 'https://cdn.nba.com/static/json/liveData/{endpoint}' + headers = STATS_HEADERS + + def clean_contents(self, contents): + if '{"Message":"An error has occurred."}' in contents: + return 'An error has occurred.' + return contents diff --git a/tests/live/endpoints/test_boxscore.py b/tests/live/endpoints/test_boxscore.py new file mode 100644 index 00000000..459db843 --- /dev/null +++ b/tests/live/endpoints/test_boxscore.py @@ -0,0 +1,64 @@ +import pytest +import json +from nba_api.library.http import NBAHTTP, NBAResponse +from nba_api.live.nba.endpoints import boxscore +from nba_api.live.nba.library.http import NBALiveHTTP + +content = {'meta': {'version': 1, 'code': 200, 'request': 'http://nba.cloud/games/0022000180/boxscore?Format=json', 'time': '2021-01-15 23:51:25.282704'}, 'game': {'gameId': '0022000180', 'gameTimeLocal': '2021-01-15T19:30:00-05:00', 'gameTimeUTC': '2021-01-16T00:30:00Z', 'gameTimeHome': '2021-01-15T19:30:00-05:00', 'gameTimeAway': '2021-01-15T19:30:00-05:00', 'gameEt': '2021-01-15T19:30:00-05:00', 'duration': 125, 'gameCode': '20210115/ORLBOS', 'gameStatusText': 'Final', 'gameStatus': 3, 'regulationPeriods': 4, 'period': 4, 'gameClock': 'PT00M00.00S', 'attendance': 0, 'sellout': '0', 'arena': {'arenaId': 17, 'arenaName': 'TD Garden', 'arenaCity': 'Boston', 'arenaState': 'MA', 'arenaCountry': 'US', 'arenaTimezone': 'America/New_York'}, 'officials': [{'personId': 201638, 'name': 'Brent Barnaky', 'nameI': 'B. Barnaky', 'firstName': 'Brent', 'familyName': 'Barnaky', 'jerseyNum': '36', 'assignment': 'OFFICIAL1'}], 'homeTeam': {'teamId': 1610612738, 'teamName': 'Celtics', 'teamCity': 'Boston', 'teamTricode': 'BOS', 'score': 124, 'inBonus': '1', 'timeoutsRemaining': 2, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 34}], 'players': [{'status': 'ACTIVE', 'order': 1, 'personId': 1627759, 'jerseyNum': '7', 'position': 'SF', 'starter': '1', 'oncourt': '0', 'played': '1', 'statistics': {'assists': 8, 'blocks': 0, 'blocksReceived': 0, 'fieldGoalsAttempted': 12, 'fieldGoalsMade': 6, 'fieldGoalsPercentage': 0.5, 'foulsOffensive': 0, 'foulsDrawn': 4, 'foulsPersonal': 1, 'foulsTechnical': 0, 'freeThrowsAttempted': 7, 'freeThrowsMade': 7, 'freeThrowsPercentage': 1.0, 'minus': 50.0, 'minutes': 'PT25M01.00S', 'minutesCalculated': 'PT25M', 'plus': 65.0, 'plusMinusPoints': 15.0, 'points': 21, 'pointsFastBreak': 0, 'pointsInThePaint': 6, 'pointsSecondChance': 0, 'reboundsDefensive': 2, 'reboundsOffensive': 0, 'reboundsTotal': 2, 'steals': 1, 'threePointersAttempted': 5, 'threePointersMade': 2, 'threePointersPercentage': 0.4, 'turnovers': 2, 'twoPointersAttempted': 7, 'twoPointersMade': 4, 'twoPointersPercentage': 0.5714285714285711}, 'name': 'Jaylen Brown', 'nameI': 'J. Brown', 'firstName': 'Jaylen', 'familyName': 'Brown'}], 'statistics': {'assists': 25, 'assistsTurnoverRatio': 2.27272727272727, 'benchPoints': 66, 'biggestLead': 29, 'biggestLeadScore': '72-101', 'biggestScoringRun': 13, 'biggestScoringRunScore': '72-101', 'blocks': 4, 'blocksReceived': 1, 'fastBreakPointsAttempted': 9, 'fastBreakPointsMade': 5, 'fastBreakPointsPercentage': 0.555555555555556, 'fieldGoalsAttempted': 88, 'fieldGoalsEffectiveAdjusted': 0.607954545454545, 'fieldGoalsMade': 45, 'fieldGoalsPercentage': 0.511363636363636, 'foulsOffensive': 0, 'foulsDrawn': 16, 'foulsPersonal': 18, 'foulsTeam': 18, 'foulsTechnical': 0, 'foulsTeamTechnical': 0, 'freeThrowsAttempted': 19, 'freeThrowsMade': 17, 'freeThrowsPercentage': 0.894736842105263, 'leadChanges': 4, 'minutes': 'PT240M00.00S', 'minutesCalculated': 'PT240M', 'points': 124, 'pointsAgainst': 97, 'pointsFastBreak': 13, 'pointsFromTurnovers': 16, 'pointsInThePaint': 48, 'pointsInThePaintAttempted': 36, 'pointsInThePaintMade': 24, 'pointsInThePaintPercentage': 0.666666666666666, 'pointsSecondChance': 11, 'reboundsDefensive': 39, 'reboundsOffensive': 6, 'reboundsPersonal': 45, 'reboundsTeam': 6, 'reboundsTeamDefensive': 2, 'reboundsTeamOffensive': 4, 'reboundsTotal': 51, 'secondChancePointsAttempted': 6, 'secondChancePointsMade': 4, 'secondChancePointsPercentage': 0.666666666666666, 'steals': 7, 'threePointersAttempted': 42, 'threePointersMade': 17, 'threePointersPercentage': 0.40476190476190504, 'timeLeading': 'PT47M16.00S', 'timesTied': 0, 'trueShootingAttempts': 96.36, 'trueShootingPercentage': 0.6434205064342051, 'turnovers': 10, 'turnoversTeam': 1, 'turnoversTotal': 11, 'twoPointersAttempted': 46, 'twoPointersMade': 28, 'twoPointersPercentage': 0.608695652173913}}, 'awayTeam': {'teamId': 1610612753, 'teamName': 'Magic', 'teamCity': 'Orlando', 'teamTricode': 'ORL', 'score': 97, 'inBonus': '1', 'timeoutsRemaining': 2, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 28}], 'players': [{'status': 'ACTIVE', 'order': 1, 'personId': 203516, 'jerseyNum': '11', 'position': 'SF', 'starter': '1', 'oncourt': '0', 'played': '1', 'statistics': {'assists': 0, 'blocks': 0, 'blocksReceived': 0, 'fieldGoalsAttempted': 4, 'fieldGoalsMade': 1, 'fieldGoalsPercentage': 0.25, 'foulsOffensive': 0, 'foulsDrawn': 0, 'foulsPersonal': 3, 'foulsTechnical': 0, 'freeThrowsAttempted': 0, 'freeThrowsMade': 0, 'freeThrowsPercentage': 0.0, 'minus': 41.0, 'minutes': 'PT14M34.00S', 'minutesCalculated': 'PT14M', 'plus': 36.0, 'plusMinusPoints': -5.0, 'points': 2, 'pointsFastBreak': 0, 'pointsInThePaint': 2, 'pointsSecondChance': 0, 'reboundsDefensive': 1, 'reboundsOffensive': 0, 'reboundsTotal': 1, 'steals': 0, 'threePointersAttempted': 2, 'threePointersMade': 0, 'threePointersPercentage': 0.0, 'turnovers': 0, 'twoPointersAttempted': 2, 'twoPointersMade': 1, 'twoPointersPercentage': 0.5}, 'name': 'James Ennis III', 'nameI': 'J. Ennis III', 'firstName': 'James', 'familyName': 'Ennis III'}], 'statistics': {'assists': 14, 'assistsTurnoverRatio': 1.07692307692308, 'benchPoints': 33, 'biggestLead': 1, 'biggestLeadScore': '4-3', 'biggestScoringRun': 13, 'biggestScoringRunScore': '72-101', 'blocks': 1, 'blocksReceived': 4, 'fastBreakPointsAttempted': 7, 'fastBreakPointsMade': 2, 'fastBreakPointsPercentage': 0.28571428571428603, 'fieldGoalsAttempted': 94, 'fieldGoalsEffectiveAdjusted': 0.441489361702128, 'fieldGoalsMade': 38, 'fieldGoalsPercentage': 0.404255319148936, 'foulsOffensive': 2, 'foulsDrawn': 18, 'foulsPersonal': 16, 'foulsTeam': 14, 'foulsTechnical': 1, 'foulsTeamTechnical': 0, 'freeThrowsAttempted': 22, 'freeThrowsMade': 14, 'freeThrowsPercentage': 0.636363636363636, 'leadChanges': 4, 'minutes': 'PT240M00.00S', 'minutesCalculated': 'PT240M', 'points': 97, 'pointsAgainst': 124, 'pointsFastBreak': 8, 'pointsFromTurnovers': 10, 'pointsInThePaint': 52, 'pointsInThePaintAttempted': 47, 'pointsInThePaintMade': 26, 'pointsInThePaintPercentage': 0.553191489361702, 'pointsSecondChance': 20, 'reboundsDefensive': 31, 'reboundsOffensive': 15, 'reboundsPersonal': 46, 'reboundsTeam': 12, 'reboundsTeamDefensive': 4, 'reboundsTeamOffensive': 8, 'reboundsTotal': 58, 'secondChancePointsAttempted': 16, 'secondChancePointsMade': 9, 'secondChancePointsPercentage': 0.5625, 'steals': 5, 'threePointersAttempted': 28, 'threePointersMade': 7, 'threePointersPercentage': 0.25, 'timeLeading': 'PT00M30.00S', 'timesTied': 0, 'trueShootingAttempts': 103.68, 'trueShootingPercentage': 0.46778549382716, 'turnovers': 11, 'turnoversTeam': 2, 'turnoversTotal': 13, 'twoPointersAttempted': 66, 'twoPointersMade': 31, 'twoPointersPercentage': 0.46969696969696995}}}} +game_details = {'gameId': '0022000180', 'gameTimeLocal': '2021-01-15T19:30:00-05:00', 'gameTimeUTC': '2021-01-16T00:30:00Z', 'gameTimeHome': '2021-01-15T19:30:00-05:00', 'gameTimeAway': '2021-01-15T19:30:00-05:00', 'gameEt': '2021-01-15T19:30:00-05:00', 'duration': 125, 'gameCode': '20210115/ORLBOS', 'gameStatusText': 'Final', 'gameStatus': 3, 'regulationPeriods': 4, 'period': 4, 'gameClock': 'PT00M00.00S', 'attendance': 0, 'sellout': '0'} +home_team_stats = {'teamId': 1610612738, 'teamName': 'Celtics', 'teamCity': 'Boston', 'teamTricode': 'BOS', 'score': 124, 'inBonus': '1', 'timeoutsRemaining': 2, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 34}], 'statistics': {'assists': 25, 'assistsTurnoverRatio': 2.27272727272727, 'benchPoints': 66, 'biggestLead': 29, 'biggestLeadScore': '72-101', 'biggestScoringRun': 13, 'biggestScoringRunScore': '72-101', 'blocks': 4, 'blocksReceived': 1, 'fastBreakPointsAttempted': 9, 'fastBreakPointsMade': 5, 'fastBreakPointsPercentage': 0.555555555555556, 'fieldGoalsAttempted': 88, 'fieldGoalsEffectiveAdjusted': 0.607954545454545, 'fieldGoalsMade': 45, 'fieldGoalsPercentage': 0.511363636363636, 'foulsOffensive': 0, 'foulsDrawn': 16, 'foulsPersonal': 18, 'foulsTeam': 18, 'foulsTechnical': 0, 'foulsTeamTechnical': 0, 'freeThrowsAttempted': 19, 'freeThrowsMade': 17, 'freeThrowsPercentage': 0.894736842105263, 'leadChanges': 4, 'minutes': 'PT240M00.00S', 'minutesCalculated': 'PT240M', 'points': 124, 'pointsAgainst': 97, 'pointsFastBreak': 13, 'pointsFromTurnovers': 16, 'pointsInThePaint': 48, 'pointsInThePaintAttempted': 36, 'pointsInThePaintMade': 24, 'pointsInThePaintPercentage': 0.666666666666666, 'pointsSecondChance': 11, 'reboundsDefensive': 39, 'reboundsOffensive': 6, 'reboundsPersonal': 45, 'reboundsTeam': 6, 'reboundsTeamDefensive': 2, 'reboundsTeamOffensive': 4, 'reboundsTotal': 51, 'secondChancePointsAttempted': 6, 'secondChancePointsMade': 4, 'secondChancePointsPercentage': 0.666666666666666, 'steals': 7, 'threePointersAttempted': 42, 'threePointersMade': 17, 'threePointersPercentage': 0.40476190476190504, 'timeLeading': 'PT47M16.00S', 'timesTied': 0, 'trueShootingAttempts': 96.36, 'trueShootingPercentage': 0.6434205064342051, 'turnovers': 10, 'turnoversTeam': 1, 'turnoversTotal': 11, 'twoPointersAttempted': 46, 'twoPointersMade': 28, 'twoPointersPercentage': 0.608695652173913}} +away_team_stats = {'teamId': 1610612753, 'teamName': 'Magic', 'teamCity': 'Orlando', 'teamTricode': 'ORL', 'score': 97, 'inBonus': '1', 'timeoutsRemaining': 2, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 28}], 'statistics': {'assists': 14, 'assistsTurnoverRatio': 1.07692307692308, 'benchPoints': 33, 'biggestLead': 1, 'biggestLeadScore': '4-3', 'biggestScoringRun': 13, 'biggestScoringRunScore': '72-101', 'blocks': 1, 'blocksReceived': 4, 'fastBreakPointsAttempted': 7, 'fastBreakPointsMade': 2, 'fastBreakPointsPercentage': 0.28571428571428603, 'fieldGoalsAttempted': 94, 'fieldGoalsEffectiveAdjusted': 0.441489361702128, 'fieldGoalsMade': 38, 'fieldGoalsPercentage': 0.404255319148936, 'foulsOffensive': 2, 'foulsDrawn': 18, 'foulsPersonal': 16, 'foulsTeam': 14, 'foulsTechnical': 1, 'foulsTeamTechnical': 0, 'freeThrowsAttempted': 22, 'freeThrowsMade': 14, 'freeThrowsPercentage': 0.636363636363636, 'leadChanges': 4, 'minutes': 'PT240M00.00S', 'minutesCalculated': 'PT240M', 'points': 97, 'pointsAgainst': 124, 'pointsFastBreak': 8, 'pointsFromTurnovers': 10, 'pointsInThePaint': 52, 'pointsInThePaintAttempted': 47, 'pointsInThePaintMade': 26, 'pointsInThePaintPercentage': 0.553191489361702, 'pointsSecondChance': +20, 'reboundsDefensive': 31, 'reboundsOffensive': 15, 'reboundsPersonal': 46, 'reboundsTeam': 12, 'reboundsTeamDefensive': 4, 'reboundsTeamOffensive': 8, 'reboundsTotal': 58, 'secondChancePointsAttempted': 16, 'secondChancePointsMade': 9, 'secondChancePointsPercentage': 0.5625, 'steals': 5, 'threePointersAttempted': 28, 'threePointersMade': 7, 'threePointersPercentage': 0.25, 'timeLeading': 'PT00M30.00S', 'timesTied': 0, 'trueShootingAttempts': 103.68, 'trueShootingPercentage': 0.46778549382716, 'turnovers': 11, 'turnoversTeam': 2, 'turnoversTotal': 13, 'twoPointersAttempted': 66, 'twoPointersMade': 31, 'twoPointersPercentage': 0.46969696969696995}} +game_id = '0022000180' + +@pytest.fixture +def nba_http_patch(monkeypatch): + class MockResponse(object): + def __init__(*args, **kwargs): + pass + + def send_api_request(self, endpoint, parameters, referer=None, proxy=None, headers=None, timeout=None, raise_exception_on_error=False): + url = NBALiveHTTP.base_url.format(endpoint=endpoint) + return NBAResponse(response=json.dumps(content), status_code=200, url=url) + + monkeypatch.setattr(NBAHTTP, "send_api_request", MockResponse.send_api_request) + + +def test_get_request_url(): + assert boxscore.BoxScore(game_id).get_request_url() == 'https://cdn.nba.com/static/json/liveData/boxscore/boxscore_0022000180.json' + +def test_get_response(nba_http_patch): + assert json.dumps(content) == boxscore.BoxScore(game_id).get_response() + +def test_get_dict(nba_http_patch): + assert boxscore.BoxScore(game_id).get_dict() == content + +def test_game_dict(nba_http_patch): + assert boxscore.BoxScore(game_id).game.get_dict() == content['game'] + +def test_arena_dict(nba_http_patch): + assert boxscore.BoxScore(game_id).arena.get_dict() == content['game']['arena'] + +def test_home_team_dict(nba_http_patch): + assert boxscore.BoxScore(game_id).home_team.get_dict() == content['game']['homeTeam'] + +def test_home_team_stats(nba_http_patch): + assert boxscore.BoxScore(game_id).home_team_stats.get_dict() == home_team_stats + +def test_home_team_player_stats(nba_http_patch): + assert boxscore.BoxScore(game_id).home_team_player_stats.get_dict() == content['game']['homeTeam']['players'] + +def test_away_team_dict(nba_http_patch): + assert boxscore.BoxScore(game_id).away_team.get_dict() == content['game']['awayTeam'] + +def test_away_team_stats(nba_http_patch): + assert boxscore.BoxScore(game_id).away_team_stats.get_dict() == away_team_stats + +def test_away_team_player_stats(nba_http_patch): + assert boxscore.BoxScore(game_id).away_team_player_stats.get_dict() == content['game']['awayTeam']['players'] + +def test_officials_dict(nba_http_patch): + assert boxscore.BoxScore(game_id).officials.get_dict() == content['game']['officials'] + +def test_game_details_dict(nba_http_patch): + assert boxscore.BoxScore(game_id).game_details.get_dict() == game_details diff --git a/tests/live/endpoints/test_playbyplay.py b/tests/live/endpoints/test_playbyplay.py new file mode 100644 index 00000000..a8bfbb04 --- /dev/null +++ b/tests/live/endpoints/test_playbyplay.py @@ -0,0 +1,30 @@ +import json +import pytest +from nba_api.library.http import NBAHTTP, NBAResponse +from nba_api.live.nba.endpoints import playbyplay +from nba_api.live.nba.library.http import NBALiveHTTP + +content = {'meta': {'version': 1, 'code': 200, 'request': 'http://nba.cloud/games/0022000180/playbyplay?Format=json', 'time': '2021-01-15 23:48:58.906160'}, 'game': {'gameId': '0022000180', 'actions': [{'actionNumber': 4, 'clock': 'PT11M58.00S', 'timeActual': '2021-01-16T00:40:31.3Z', 'period': 1, 'periodType': 'REGULAR', 'teamId': 1610612738, 'teamTricode': 'BOS', 'actionType': 'jumpball', 'subType': 'recovered', 'descriptor': 'startperiod', 'qualifiers': [], 'personId': 1629684, 'x': None, 'y': None, 'possession': 1610612738, 'scoreHome': '0', 'scoreAway': '0', 'edited': '2021-01-16T00:40:31Z', 'orderNumber': 40000, 'xLegacy': None, 'yLegacy': None, 'isFieldGoal': 0, 'jumpBallRecoveredName': 'G. Williams', 'jumpBallRecoverdPersonId': 1629684, 'side': None, 'playerName': 'Williams', 'playerNameI': 'G. Williams', 'personIdsFilter': [1629684, 202684, 202696], 'jumpBallWonPlayerName': 'Thompson', 'jumpBallWonPersonId': 202684, 'description': 'Jump Ball T. Thompson vs. N. Vucevic: Tip to G. Williams', 'jumpBallLostPlayerName': 'Vucevic', 'jumpBallLostPersonId': 202696}]}} +actions = [{'actionNumber': 4, 'clock': 'PT11M58.00S', 'timeActual': '2021-01-16T00:40:31.3Z', 'period': 1, 'periodType': 'REGULAR', 'teamId': 1610612738, 'teamTricode': 'BOS', 'actionType': 'jumpball', 'subType': 'recovered', 'descriptor': 'startperiod', 'qualifiers': [], 'personId': 1629684, 'x': None, 'y': None, 'possession': 1610612738, 'scoreHome': '0', 'scoreAway': '0', 'edited': '2021-01-16T00:40:31Z', 'orderNumber': 40000, 'xLegacy': None, 'yLegacy': None, 'isFieldGoal': 0, 'jumpBallRecoveredName': 'G. Williams', 'jumpBallRecoverdPersonId': 1629684, 'side': None, 'playerName': 'Williams', 'playerNameI': 'G. Williams', 'personIdsFilter': [1629684, 202684, 202696], 'jumpBallWonPlayerName': 'Thompson', 'jumpBallWonPersonId': 202684, 'description': 'Jump Ball T. Thompson vs. N. Vucevic: Tip to G. Williams', 'jumpBallLostPlayerName': 'Vucevic', 'jumpBallLostPersonId': 202696}] +game_id = '0022000180' + +@pytest.fixture +def nba_http_patch(monkeypatch): + class MockResponse(object): + def __init__(*args, **kwargs): + pass + + def send_api_request(self, endpoint, parameters, referer=None, proxy=None, headers=None, timeout=None, raise_exception_on_error=False): + url = NBALiveHTTP.base_url.format(endpoint=endpoint) + return NBAResponse(response=json.dumps(content), status_code=200, url=url) + + monkeypatch.setattr(NBAHTTP, "send_api_request", MockResponse.send_api_request) + +def test_get_request_url(nba_http_patch): + assert playbyplay.PlayByPlay(game_id).get_request_url() == 'https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_0022000180.json' + +def test_get_actions_dict(nba_http_patch): + assert playbyplay.PlayByPlay(game_id).actions.get_dict() == actions + +def test_get_dict(nba_http_patch): + assert playbyplay.PlayByPlay(game_id).get_dict() == content \ No newline at end of file diff --git a/tests/live/endpoints/test_scoreboard.py b/tests/live/endpoints/test_scoreboard.py new file mode 100644 index 00000000..929e4699 --- /dev/null +++ b/tests/live/endpoints/test_scoreboard.py @@ -0,0 +1,35 @@ +import json +import pytest +from nba_api.library.http import NBAHTTP, NBAResponse +from nba_api.live.nba.endpoints import scoreboard +from nba_api.live.nba.library.http import NBALiveHTTP + +content = {'meta': {'version': 1, 'request': 'https://nba-prod-us-east-1-mediaops-stats.s3.amazonaws.com/NBA/liveData/scoreboard/todaysScoreboard_00.json', 'time': '2021-01-16 02:21:14.2114', 'code': 200}, 'scoreboard': {'gameDate': '2021-01-16', 'leagueId': '00', 'leagueName': 'National Basketball Association', 'games': [{'gameId': '0022000194', 'gameCode': '20210116/INDPHX', 'gameStatus': 1, 'gameStatusText': 'PPD', 'period': 0, 'gameClock': '', 'gameTimeUTC': '2021-01-17T02:00:00Z', 'gameEt': '2021-01-16T21:00:00Z', 'regulationPeriods': 4, 'seriesGameNumber': '', 'seriesText': '', 'homeTeam': {'teamId': 1610612756, 'teamName': 'Suns', 'teamCity': 'Phoenix', 'teamTricode': 'PHX', 'wins': 7, 'losses': 4, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 0}, {'period': 2, 'periodType': 'REGULAR', 'score': 0}, {'period': 3, 'periodType': 'REGULAR', 'score': 0}, {'period': 4, 'periodType': 'REGULAR', 'score': 0}]}, 'awayTeam': {'teamId': 1610612754, 'teamName': 'Pacers', 'teamCity': 'Indiana', 'teamTricode': 'IND', 'wins': 8, 'losses': 4, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 0}, {'period': 2, 'periodType': 'REGULAR', 'score': 0}, {'period': 3, 'periodType': 'REGULAR', 'score': 0}, {'period': 4, 'periodType': 'REGULAR', 'score': 0}]}, 'gameLeaders': {'homeLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': 'PHX', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}, 'awayLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': 'IND', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}}, 'pbOdds': {'team': None, 'odds': 0.0, 'suspended': 1}}, {'gameId': '0022000189', 'gameCode': '20210116/HOUSAS', 'gameStatus': 1, 'gameStatusText': '5:00 pm ET', 'period': 0, 'gameClock': '', 'gameTimeUTC': '2021-01-16T22:00:00Z', 'gameEt': '2021-01-16T17:00:00Z', 'regulationPeriods': 4, 'seriesGameNumber': '', 'seriesText': '', 'homeTeam': {'teamId': 1610612759, 'teamName': 'Spurs', 'teamCity': 'San Antonio', 'teamTricode': 'SAS', 'wins': 6, 'losses': 6, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 0}, {'period': 2, 'periodType': 'REGULAR', 'score': 0}, {'period': 3, 'periodType': 'REGULAR', 'score': 0}, {'period': 4, 'periodType': 'REGULAR', 'score': 0}]}, 'awayTeam': {'teamId': 1610612745, 'teamName': 'Rockets', 'teamCity': 'Houston', 'teamTricode': 'HOU', 'wins': 4, 'losses': 6, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 0}, {'period': 2, 'periodType': 'REGULAR', 'score': 0}, {'period': 3, 'periodType': 'REGULAR', 'score': 0}, {'period': 4, 'periodType': 'REGULAR', 'score': 0}]}, 'gameLeaders': {'homeLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': 'SAS', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}, 'awayLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': 'HOU', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}}, 'pbOdds': {'team': None, 'odds': 0.0, 'suspended': 1}}]}} +games = [{'gameId': '0022000194', 'gameCode': '20210116/INDPHX', 'gameStatus': 1, 'gameStatusText': 'PPD', 'period': 0, 'gameClock': '', 'gameTimeUTC': '2021-01-17T02:00:00Z', 'gameEt': '2021-01-16T21:00:00Z', 'regulationPeriods': 4, 'seriesGameNumber': '', 'seriesText': '', 'homeTeam': {'teamId': 1610612756, 'teamName': 'Suns', 'teamCity': 'Phoenix', 'teamTricode': 'PHX', 'wins': 7, 'losses': 4, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 0}, {'period': 2, 'periodType': 'REGULAR', 'score': 0}, {'period': 3, 'periodType': 'REGULAR', 'score': 0}, {'period': 4, 'periodType': 'REGULAR', 'score': 0}]}, 'awayTeam': {'teamId': 1610612754, 'teamName': 'Pacers', 'teamCity': 'Indiana', 'teamTricode': 'IND', 'wins': 8, 'losses': 4, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 0}, {'period': 2, 'periodType': 'REGULAR', 'score': 0}, {'period': 3, 'periodType': 'REGULAR', 'score': 0}, {'period': 4, 'periodType': 'REGULAR', 'score': 0}]}, 'gameLeaders': {'homeLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': 'PHX', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}, 'awayLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': 'IND', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}}, 'pbOdds': {'team': None, 'odds': 0.0, 'suspended': 1}}, {'gameId': '0022000189', 'gameCode': '20210116/HOUSAS', 'gameStatus': 1, 'gameStatusText': '5:00 pm ET', 'period': 0, 'gameClock': '', 'gameTimeUTC': '2021-01-16T22:00:00Z', 'gameEt': '2021-01-16T17:00:00Z', 'regulationPeriods': 4, 'seriesGameNumber': '', 'seriesText': '', 'homeTeam': {'teamId': 1610612759, 'teamName': 'Spurs', 'teamCity': 'San Antonio', 'teamTricode': 'SAS', 'wins': 6, 'losses': 6, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 0}, {'period': 2, 'periodType': 'REGULAR', 'score': 0}, {'period': 3, 'periodType': 'REGULAR', 'score': 0}, {'period': 4, 'periodType': 'REGULAR', 'score': 0}]}, 'awayTeam': {'teamId': 1610612745, 'teamName': 'Rockets', 'teamCity': 'Houston', 'teamTricode': 'HOU', 'wins': 4, 'losses': 6, 'score': 0, 'inBonus': None, 'timeoutsRemaining': 0, 'periods': [{'period': 1, 'periodType': 'REGULAR', 'score': 0}, {'period': 2, 'periodType': 'REGULAR', 'score': 0}, {'period': 3, 'periodType': 'REGULAR', 'score': 0}, {'period': 4, 'periodType': 'REGULAR', 'score': 0}]}, 'gameLeaders': {'homeLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': 'SAS', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}, 'awayLeaders': {'personId': 0, 'name': '', 'jerseyNum': '', 'position': '', 'teamTricode': 'HOU', 'playerSlug': None, 'points': 0, 'rebounds': 0, 'assists': 0}}, 'pbOdds': {'team': None, 'odds': 0.0, 'suspended': 1}}] + +@pytest.fixture +def nba_http_patch(monkeypatch): + class MockResponse(object): + def __init__(*args, **kwargs): + pass + + def send_api_request(self, endpoint, parameters, referer=None, proxy=None, headers=None, timeout=None, raise_exception_on_error=False): + url = NBALiveHTTP.base_url.format(endpoint=endpoint) + return NBAResponse(response=json.dumps(content), status_code=200, url=url) + + monkeypatch.setattr(NBAHTTP, "send_api_request", MockResponse.send_api_request) + +def test_get_score_board_date(nba_http_patch): + assert scoreboard.ScoreBoard().score_board_date == '2021-01-16' + +def test_get_games_dict(nba_http_patch): + assert scoreboard.ScoreBoard().games.get_dict() == games + +def test_get_request_url(nba_http_patch): + assert scoreboard.ScoreBoard().get_request_url() == 'https://cdn.nba.com/static/json/liveData/scoreboard/todaysScoreboard_00.json' + +def test_get_dict(nba_http_patch): + assert scoreboard.ScoreBoard().get_dict() == content + + + \ No newline at end of file