diff --git a/src/__pycache__/boxscores.cpython-310.pyc b/src/__pycache__/boxscores.cpython-310.pyc new file mode 100644 index 0000000..75b1d7a Binary files /dev/null and b/src/__pycache__/boxscores.cpython-310.pyc differ diff --git a/src/boxscores.py b/src/boxscores.py new file mode 100644 index 0000000..99a96ad --- /dev/null +++ b/src/boxscores.py @@ -0,0 +1,22 @@ +from nba_api.stats.endpoints import boxscoretraditionalv2 +from nba_api.stats.static import teams +from nba_api.stats.endpoints import leaguegamefinder + +def boxscores_For_Latest_Game(): + + nba_teams = teams.get_teams() + # Select the dictionary for the Celtics, which contains their team ID + kings = [team for team in nba_teams if team['abbreviation'] == 'SAC'][0] + kings_id = kings['id'] + + + # Query for games where the Celtics were playing + gamefinder = leaguegamefinder.LeagueGameFinder(team_id_nullable=kings_id) + # The first DataFrame of those returned is what we want. + games = gamefinder.get_data_frames()[0] + games.head() + + + boxScore = boxscoretraditionalv2.BoxScoreTraditionalV2(games.head()["GAME_ID"][0]) + + return(boxScore.get_dict()) diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..5ce2876 --- /dev/null +++ b/src/index.html @@ -0,0 +1,55 @@ + + +
+ + +| Player | +FGM | +FGA | ++ | + + |
|---|