Exemple #1
0
 def shots(self, player_id = 0, outcome="", location="", month=0, season_segment="", date_from="", date_to="", opponent_team_id=0, vs_conference="", vs_division="", position="", game_segment="", rookie_year="", period=0, last_n_games=0, context_measure="FG_PCT"):
     game_shots = []
     for team in self.teams:
         parameters = {
                         "GameID": self.game_id,
                         "Season": self.season,
                         "SeasonType": self.season_type,
                         "TeamID": team,
                         "PlayerID": player_id,
                         "Outcome": outcome,
                         "Location": location,
                         "Month": month,
                         "SeasonSegment": season_segment,
                         "DateFrom": date_from,
                         "DateTo": date_to,
                         "OpponentTeamID": opponent_team_id,
                         "VsConference": vs_conference,
                         "VsDivision": vs_division,
                         "Position": position,
                         "RookieYear": rookie_year,
                         "GameSegment": game_segment,
                         "Period": period,
                         "LastNGames":  last_n_games,
                         "ContextMeasure": context_measure
         }
         game_shots += helper.get_data_from_url_with_parameters(self.shots_base_url, parameters, 0)
     return game_shots
Exemple #2
0
def get_sportvu_data_for_stat(season, season_type, player_or_team, measure_type, start_date="", end_date="", last_n_games=0, league_id="00", month=0, opponent_team_id=0, por_round=0, per_mode="Totals", team_id=0, outcome="", location="", season_segment="", vs_conference="", vs_division="", game_scope="", player_experience="", player_position="", starter_bench=""):
    parameters = {
                    "DateFrom": start_date,
                    "DateTo": end_date,
                    "PlayerOrTeam": player_or_team,
                    "PtMeasureType": measure_type,
                    "Season": season,
                    "SeasonType": season_type,
                    "LastNGames": last_n_games,
                    "LeagueID": league_id,
                    "Month": month,
                    "OpponentTeamID": opponent_team_id,
                    "PORound": por_round,
                    "PerMode": per_mode,
                    "TeamID": team_id,
                    "Outcome": outcome,
                    "Location": location,
                    "SeasonSegment": season_segment,
                    "VsConference": vs_conference,
                    "VsDivision": vs_division,
                    "GameScope": game_scope,
                    "PlayerExperience": player_experience,
                    "PlayerPosition": player_position,
                    "StarterBench": starter_bench
    }
    base_url = "http://stats.nba.com/stats/leaguedashptstats"
    return helper.get_data_from_url_with_parameters(base_url, parameters, 0)
def get_sportvu_data_for_stat(season, season_type, player_or_team, measure_type, start_date="", end_date="", last_n_games=0, league_id="00", month=0, opponent_team_id=0, por_round=0, per_mode="Totals", team_id=0, outcome="", location="", season_segment="", vs_conference="", vs_division="", game_scope="", player_experience="", player_position="", starter_bench=""):
    parameters = {
                    "DateFrom": start_date,
                    "DateTo": end_date,
                    "PlayerOrTeam": player_or_team,
                    "PtMeasureType": measure_type,
                    "Season": season,
                    "SeasonType": season_type,
                    "LastNGames": last_n_games,
                    "LeagueID": league_id,
                    "Month": month,
                    "OpponentTeamID": opponent_team_id,
                    "PORound": por_round,
                    "PerMode": per_mode,
                    "TeamID": team_id,
                    "Outcome": outcome,
                    "Location": location,
                    "SeasonSegment": season_segment,
                    "VsConference": vs_conference,
                    "VsDivision": vs_division,
                    "GameScope": game_scope,
                    "PlayerExperience": player_experience,
                    "PlayerPosition": player_position,
                    "StarterBench": starter_bench
    }
    base_url = "http://stats.nba.com/stats/leaguedashptstats"
    return helper.get_data_from_url_with_parameters(base_url, parameters, 0)
Exemple #4
0
 def scoring_boxscore_team(self, start_period=0, end_period=10, range_type=2, start_range=0, end_range=55800):
     parameters = {
                     "GameId": self.game_id,
                     "StartPeriod": start_period,
                     "EndPeriod": end_period,
                     "RangeType": range_type,
                     "StartRange": start_range,
                     "EndRange": end_range
     }
     return helper.get_data_from_url_with_parameters(self.scoring_boxscore_base_url, parameters, 1)
Exemple #5
0
 def advanced_boxscore(self,
                       start_period=0,
                       end_period=10,
                       range_type=2,
                       start_range=0,
                       end_range=55800):
     parameters = {
         "GameId": self.game_id,
         "StartPeriod": start_period,
         "EndPeriod": end_period,
         "RangeType": range_type,
         "StartRange": start_range,
         "EndRange": end_range
     }
     return helper.get_data_from_url_with_parameters(
         self.advanced_boxscore_base_url, parameters, 0)
Exemple #6
0
 def shots(self,
           player_id=0,
           outcome="",
           location="",
           month=0,
           season_segment="",
           date_from="",
           date_to="",
           opponent_team_id=0,
           vs_conference="",
           vs_division="",
           position="",
           game_segment="",
           rookie_year="",
           period=0,
           last_n_games=0,
           context_measure="FG_PCT"):
     game_shots = []
     for team in self.teams:
         parameters = {
             "GameID": self.game_id,
             "Season": self.season,
             "SeasonType": self.season_type,
             "TeamID": team,
             "PlayerID": player_id,
             "Outcome": outcome,
             "Location": location,
             "Month": month,
             "SeasonSegment": season_segment,
             "DateFrom": date_from,
             "DateTo": date_to,
             "OpponentTeamID": opponent_team_id,
             "VsConference": vs_conference,
             "VsDivision": vs_division,
             "Position": position,
             "RookieYear": rookie_year,
             "GameSegment": game_segment,
             "Period": period,
             "LastNGames": last_n_games,
             "ContextMeasure": context_measure
         }
         game_shots += helper.get_data_from_url_with_parameters(
             self.shots_base_url, parameters, 0)
     return game_shots
 def passes_received(self, league_id="00", team_id=0, outcome="", location="", month=0, season_segment="", date_from="", date_to="", opponent_team_id=0, vs_conference="", vs_division="", game_segment="", period=0, last_n_games=0, per_mode="Totals"):
     parameters = {
                     "LeagueID": league_id,
                     "Season": self.season,
                     "SeasonType": self.season_type,
                     "PlayerID": self.player_id,
                     "TeamID": team_id,
                     "Outcome": outcome,
                     "Location": location,
                     "Month": month,
                     "SeasonSegment": season_segment,
                     "DateFrom": date_from,
                     "DateTo": date_to,
                     "OpponentTeamID": opponent_team_id,
                     "VsConference": vs_conference,
                     "VsDivision": vs_division,
                     "GameSegment": game_segment,
                     "Period": period,
                     "LastNGames": last_n_games,
                     "PerMode": per_mode
     }
     return helper.get_data_from_url_with_parameters(self.player_tracking_passes_base_url, parameters, 1)
Exemple #8
0
 def player_tracking_boxscore_team(self):
     parameters = {"GameId": self.game_id}
     return helper.get_data_from_url_with_parameters(self.player_tracking_boxscore_base_url, parameters, 1)
Exemple #9
0
 def line_score(self):
     parameters = {"GameId": self.game_id}
     return helper.get_data_from_url_with_parameters(self.summary_base_url, parameters, 5)
Exemple #10
0
 def player_tracking_boxscore_team(self):
     parameters = {"GameId": self.game_id}
     return helper.get_data_from_url_with_parameters(
         self.player_tracking_boxscore_base_url, parameters, 1)
Exemple #11
0
 def line_score(self):
     parameters = {"GameId": self.game_id}
     return helper.get_data_from_url_with_parameters(
         self.summary_base_url, parameters, 5)