• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.get_response函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中nba.utils.get_response函数的典型用法代码示例。如果您正苦于以下问题:Python get_response函数的具体用法?Python get_response怎么用?Python get_response使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_response函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: play_by_play

def play_by_play(game_id):
    """
    return play by play data for a given game
    args:
        game_id (int)
    returns:
        plays (list)

    each player is a dict with the following available keys
    ["GAME_ID","EVENTNUM","EVENTMSGTYPE","EVENTMSGACTIONTYPE","PERIOD",
    "WCTIMESTRING","PCTIMESTRING","HOMEDESCRIPTION","NEUTRALDESCRIPTION",
    "VISITORDESCRIPTION","SCORE","SCOREMARGIN","PERSON1TYPE","PLAYER1_ID",
    "PLAYER1_NAME","PLAYER1_TEAM_ID","PLAYER1_TEAM_CITY",
    "PLAYER1_TEAM_NICKNAME","PLAYER1_TEAM_ABBREVIATION","PERSON2TYPE",
    "PLAYER2_ID","PLAYER2_NAME","PLAYER2_TEAM_ID","PLAYER2_TEAM_CITY",
    "PLAYER2_TEAM_NICKNAME","PLAYER2_TEAM_ABBREVIATION","PERSON3TYPE",
    "PLAYER3_ID","PLAYER3_NAME","PLAYER3_TEAM_ID","PLAYER3_TEAM_CITY",
    "PLAYER3_TEAM_NICKNAME","PLAYER3_TEAM_ABBREVIATION"]

    """
    endpoint = 'http://stats.nba.com/stats/playbyplayv2'
    payload = {
        'GameID': game_id,
        'StartPeriod': 1,
        'EndPeriod': 10,
        'StartRange': 0,
        'EndRange': 28800,
        'RangeType': 0
    }
    response = utils.get_response(endpoint, payload)
    return response['PlayerStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:31,代码来源:basic.py


示例2: all_players

def all_players(season, all_time=False):
    """
    return all players
    args:
        season: format ex: '1999-00', also accepts 1999 or 99
    returns:
        players (list)

    each player is a dict with the following available keys
    ["PERSON_ID","DISPLAY_LAST_COMMA_FIRST","ROSTERSTATUS","FROM_YEAR",
    "TO_YEAR","PLAYERCODE"]

    """

    # IsOnlyCurrentSeason: 0 is false 1 is true
    cur_season = 1
    if all_time:
        cur_season = 0

    endpoint = 'http://stats.nba.com/stats/commonallplayers'
    payload = {
        "LeagueID": "00",
        "Season": utils.cleanse_season(season),
        "IsOnlyCurrentSeason": cur_season
    }
    response = utils.get_response(endpoint, payload)
    return response['CommonAllPlayers']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:27,代码来源:basic.py


示例3: standings_from_date

def standings_from_date(date):
    """
    return the standing on a given date
    args:
        date (string): format=mm/dd/yyyy
    returns:
        standings (dict) keys are 'EAST', and 'WEST'
            values are teams

    teams (list): games that happen that day

    each team is a dict with the following available keys
    ["TEAM_ID","LEAGUE_ID","SEASON_ID","STANDINGSDATE","CONFERENCE","TEAM",
    "G","W","L","W_PCT","HOME_RECORD","ROAD_RECORD"]

    """
    endpoint = 'http://stats.nba.com/stats/scoreboardv2'
    payload = {
        'DayOffset': '0',
        'LeagueID': '00',
        'gameDate': date
    }
    response = utils.get_response(endpoint, payload)
    return {
        'EAST': response['EastConfStandingsByDay'],
        'WEST': response['WestConfStandingsByDay']
    }
开发者ID:Sandy4321,项目名称:NBapi,代码行数:27,代码来源:basic.py


示例4: team_game_log

def team_game_log(team_id, season):
    """
    return games that a team has already played in given season
    args:
        team_id (int)
        season: format ex: '1999-00', also accepts 1999 or 99
    returns:
        games (list): games a team has played in given season

    each game is a dict with the following available keys
    ["TEAM_ID","GAME_ID","GAME_DATE","MATCHUP","WL","MIN",
    "FGM","FGA","FG_PCT","FG3M","FG3A","FG3_PCT","FTM",
    "FTA","FT_PCT","OREB","DREB","REB","AST","STL","BLK",
    "TOV","PF","PTS"]

    """
    endpoint = 'http://stats.nba.com/stats/teamgamelog'
    payload = {
        "TeamID": team_id,
        "LeagueID": "00",
        "Season": utils.cleanse_season(season),
        "SeasonType": "Regular Season"
    }
    response = utils.get_response(endpoint, payload)
    return response['TeamGameLog']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:25,代码来源:basic.py


示例5: player_game_log

def player_game_log(player_id, season):
    """
    return games that a player has already played in given season
    args:
        player_id (int)
        season: format ex: '1999-00', also accepts 1999 or 99
    returns:
        games (list): games a player has played in given season

    each game is a dict with the following available keys
    ["SEASON_ID","PLAYER_ID","GAME_ID","GAME_DATE","MATCHUP","WL","MIN",
    "FGM","FGA","FG_PCT","FG3M","FG3A","FG3_PCT","FTM","FTA","FT_PCT",
    "OREB","DREB","REB","AST","STL","BLK","TOV","PF","PTS","PLUS_MINUS",
    "VIDEO_AVAILABLE"]

    """
    endpoint = 'http://stats.nba.com/stats/playergamelog'
    payload = {
        "PlayerID": player_id,
        "LeagueID": "00",
        "Season": utils.cleanse_season(season),
        "SeasonType": "Regular Season"
    }
    response = utils.get_response(endpoint, payload)
    return response['PlayerGameLog']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:25,代码来源:basic.py


示例6: player_game_shot_chart

def player_game_shot_chart(game_id, team_id, player_id):
    # TODO check to make sure correct 
    """
    return player tracking information for a given game
    args:
        game_id (int)
        #TODO get team_id from player_id
        team_id (int)
        player_id (int)
    returns:
        shots (list): shots a player attempted during a game

    each player is a dict with the following available keys
    ["GRID_TYPE","GAME_ID","GAME_EVENT_ID","PLAYER_ID","PLAYER_NAME","TEAM_ID",
    "TEAM_NAME","PERIOD","MINUTES_REMAINING","SECONDS_REMAINING","EVENT_TYPE",
    "ACTION_TYPE","SHOT_TYPE","SHOT_ZONE_BASIC","SHOT_ZONE_AREA",
    "SHOT_ZONE_RANGE","SHOT_DISTANCE","LOC_X","LOC_Y","SHOT_ATTEMPTED_FLAG",
    "SHOT_MADE_FLAG"]

    """
    endpoint = 'http://stats.nba.com/stats/shotchartdetail'
    payload = {
        "LeagueID": "00",
        #see if need season or can get from game_id
        "Season": "2014-15",
        "SeasonType": "Regular Season",
        "TeamID": team_id,
        "PlayerID": player_id,
        "GameID": game_id,
        "Outcome": None,
        "Location": None,
        "Month": 0,
        "SeasonSegment": None,
        "DateFrom": None,
        "DateTo": None,
        "OpponentTeamID": 0,
        "VsConference": None,
        "VsDivision": None,
        "Position": None,
        "RookieYear": None,
        "GameSegment": None,
        "Period": 0,
        "LastNGames": 0,
        "ClutchTime": None,
        "AheadBehind": None,
        "PointDiff": None,
        "RangeType": 2,
        "StartPeriod": 1,
        "EndPeriod": 10,
        "StartRange": 0,
        "EndRange": 28800,
        "ContextFilter": "",
        "ContextMeasure": "FGA"
    }
    response = utils.get_response(endpoint, payload)
    return response['Shot_Chart_Detail']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:56,代码来源:basic.py


示例7: league_leaders

def league_leaders(season):
    # TODO document
    endpoint = 'http://stats.nba.com/stats/leagueleaders'
    payload = {
        "LeagueID": "00",
        "PerMode": "PerGame",
        "StatCategory": "PTS",
        "Season": util.cleanse_season(season),
        "SeasonType": "Regular Season",
        "Scope": "S"
    }
    response = utils.get_response(endpoint, payload)
    return response['LeagueLeaders']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:13,代码来源:basic.py


示例8: team_screen_def

def team_screen_def():
    """
    returns synergy screen data for all teams this season
    returns:
        teams (list): offensive stats for off screen plays for all teams

    each team is a dict with the following available keys
    ["TeamIDSID","TeamName","TeamNameAbbreviation","TeamShortName","GP","Poss",
    "Time","Points","FGA","FGM","PPP","WorsePPP","BetterPPP","PossG","PPG",
    "FGAG","FGMG","FGmG","FGm","FG","aFG","FT","TO","SF","PlusOne","Score"]

    """
    endpoint = 'http://stats.nba.com/js/data/playtype/team_OffScreen.js'
    response = utils.get_response(endpoint, None)
    return response['Defensive']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:15,代码来源:synergy.py


示例9: player_pnr_handler_off

def player_pnr_handler_off():
    """
    returns synergy PnR ball handler data for all players this season
    returns:
        players (list): data for all players

    each player is a dict with the following available keys
    ["PlayerIDSID","PlayerFirstName","PlayerLastName","PlayerNumber","P",
    "TeamIDSID","TeamName","TeamNameAbbreviation","TeamShortName","GP","Poss",
    "Time","Points","FGA","FGM","PPP","WorsePPP","BetterPPP","PossG","PPG",
    "FGAG","FGMG","FGmG","FGm","FG","aFG","FT","TO","SF","PlusOne","Score"]

    """
    endpoint = 'http://stats.nba.com/js/data/playtype/player_PRBallHandler.js'
    response = utils.get_response(endpoint, None)
    return response['Offensive']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:16,代码来源:synergy.py


示例10: team_drive

def team_drive(season):
    """
    returns sportsvu driving data for all teams
    args:
        season
    returns:
        teams (list): driving data for all teams

    each team is a dict with the following available keys
    ["TEAM_ID","TEAM_CITY","TEAM_NAME","TEAM_ABBREVIATION","TEAM_CODE","GP",
    "MIN","DVS","DPP","DTP","FG_PCT","PTS_48","DPP_TOT","DVS_TOT"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/drivesTeamData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['TeamTrackingDrivesStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:16,代码来源:svu.py


示例11: player_drive

def player_drive(season):
    """
    returns sportsvu driving data for all players
    args:
        season
    returns:
        players (list): driving data for all players

    each player is a dict with the following available keys
    ["PLAYER_ID","PLAYER","FIRST_NAME","LAST_NAME","TEAM_ABBREVIATION","GP",
    "MIN","DVS","DPP","DTP","FG_PCT","PTS_48","DPP_TOT","DVS_TOT"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/drivesData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['PlayerTrackingDrivesStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:16,代码来源:svu.py


示例12: team_touches

def team_touches(season):
    """
    returns sportsvu touches data for all teams
    args:
        season
    returns:
        teams (list): touches data for all teams

    each team is a dict with the following available keys
    ["TEAM_ID","TEAM_CITY","TEAM_NAME","TEAM_ABBREVIATION","TEAM_CODE","GP",
    "MIN","TCH","FC_TCH","TOP","CL_TCH","EL_TCH","PTS","PTS_TCH","PTS_HCCT",
    "TCH_TOT"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/touchesTeamData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['TeamTrackingTouchesStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:17,代码来源:svu.py


示例13: team_passing

def team_passing(season):
    """
    returns sportsvu passing data for all teams
    args:
        season
    returns:
        teams (list): passing data for all teams

    each team is a dict with the following available keys
    ["TEAM_ID","TEAM_CITY","TEAM_NAME","TEAM_ABBREVIATION","TEAM_CODE","GP",
    "MIN","PASS","AST","AST_FT","AST_SEC","AST_POT","PTS_CRT","PTS_CRT_48",
    "AST_TOT"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/passingTeamData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['TeamTrackingPassingStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:17,代码来源:svu.py


示例14: team_speed

def team_speed(season):
    """
    returns sportsvu speed data for all teams
    args:
        season
    returns:
        teams (list): speed data for all teams

    each team is a dict with the following available keys
    ["TEAM_ID","TEAM_CITY","TEAM_NAME","TEAM_ABBREVIATION","TEAM_CODE","GP",
    "MIN","DIST","AV_SPD","DIST_PG","DIST_48","DIST_OFF","DIST_DEF",
    "AV_SPD_OFF","AV_SPD_DEF"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/speedTeamData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['TeamTrackingSpeedStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:17,代码来源:svu.py


示例15: team_catch_shoot

def team_catch_shoot(season):
    """
    returns sportsvu catch and shoot data for all teams
    args:
        season
    returns:
        teams (list): catch and shoot data for all teams

    each team is a dict with the following available keys
    ["TEAM_ID","TEAM_CITY","TEAM_NAME","TEAM_ABBREVIATION","TEAM_CODE","GP",
    "MIN","PTS","FGM","FGA","FG_PCT","FG3M","FG3A","FG3_PCT","EFG_PCT",
    "PTS_TOT"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/catchShootTeamData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['TeamTrackingCatchShootStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:17,代码来源:svu.py


示例16: player_passing

def player_passing(season):
    """
    returns sportsvu passing data for all players
    args:
        season
    returns:
        players (list): passing data for all players

    each player is a dict with the following available keys
    ["PLAYER_ID","PLAYER","FIRST_NAME","LAST_NAME","TEAM_ABBREVIATION","GP",
    "MIN","PASS","AST","AST_FT","AST_SEC","AST_POT","PTS_CRT","PTS_CRT_48",
    "AST_TOT"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/passingData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['PlayerTrackingPassingStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:17,代码来源:svu.py


示例17: player_touches

def player_touches(season):
    """
    returns sportsvu touches data for all players
    args:
        season
    returns:
        players (list): touches data for all players

    each player is a dict with the following available keys
    ["PLAYER_ID","PLAYER","FIRST_NAME","LAST_NAME","TEAM_ABBREVIATION","GP",
    "MIN","TCH","FC_TCH","TOP","CL_TCH","EL_TCH","PTS","PTS_TCH","PTS_HCCT",
    "TCH_TOT"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/touchesData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['PlayerTrackingTouchesStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:17,代码来源:svu.py


示例18: player_pull_up

def player_pull_up(season):
    """
    returns sportsvu pull up shooting data for all players
    args:
        season
    returns:
        players (list): pull up shooting data for all players

    each player is a dict with the following available keys
    ["PLAYER_ID","PLAYER","FIRST_NAME","LAST_NAME","TEAM_ABBREVIATION","GP",
    "MIN","PTS","FGM","FGA","FG_PCT","FG3M","FG3A","FG3_PCT","EFG_PCT",
    "PTS_TOT"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/pullUpShootData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['PlayerTrackingPullUpShootStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:17,代码来源:svu.py


示例19: all_players_stats

def all_players_stats(season):
    # TODO all users to specify what type of stats
    """
    return basic stats for all players in a season
    args:
        season: format ex: '1999-00', also accepts 1999 or 99
    returns:
        players (list): players and their stats for the season

    each player is a dict with the following available keys
    ["PLAYER_ID","PLAYER_NAME","TEAM_ID","TEAM_ABBREVIATION","GP","W","L",
    "W_PCT","MIN","FGM","FGA","FG_PCT","FG3M","FG3A","FG3_PCT","FTM","FTA",
    "FT_PCT","OREB","DREB","REB","AST","TOV","STL","BLK","BLKA","PF","PFD",
    "PTS","PLUS_MINUS","DD2","TD3","CFID","CFPARAMS"]

    """
    endpoint = 'http://stats.nba.com/stats/leaguedashplayerstats'
    payload = {
        "MeasureType":"Base",
        "PerMode":"PerGame",
        "PlusMinus":"N",
        "PaceAdjust":"N",
        "Rank":"N",
        "LeagueID":"00",
        "Season":utils.cleanse_season(season),
        "SeasonType":"Regular Season",
        "Outcome": None,
        "Location": None,
        "Month":0,
        "SeasonSegment": None,
        "DateFrom": None,
        "DateTo": None,
        "OpponentTeamID":0,
        "VsConference": None,
        "VsDivision": None,
        "GameSegment": None,
        "Period":0,
        "LastNGames":0,
        "GameScope": None,
        "PlayerExperience": None,
        "PlayerPosition": None,
        "StarterBench": None
    }
    response = utils.get_response(endpoint, payload)
    # TODO get corrent name
    return response['LeagueDashPlayerStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:46,代码来源:basic.py


示例20: player_speed

def player_speed(season):
    """
    returns sportsvu speed data for all players
    args:
        season
    returns:
        players (list): speed data for all players

    each player is a dict with the following available keys
    ["PLAYER_ID","PLAYER","FIRST_NAME","LAST_NAME","TEAM_ABBREVIATION","GP",
    "MIN","DIST","AV_SPD","DIST_PG","DIST_48","DIST_OFF","DIST_DEF",
    "AV_SPD_OFF","AV_SPD_DEF"]

    """
    endpoint = 'http://stats.nba.com/js/data/sportvu/%s/speedData.json' % util.season_to_int(season)
    response = utils.get_response(endpoint, None)
    return response['PlayerTrackingSpeedStats']
开发者ID:Sandy4321,项目名称:NBapi,代码行数:17,代码来源:svu.py



注:本文中的nba.utils.get_response函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python nba_py._api_scrape函数代码示例发布时间:2022-05-27
下一篇:
Python navigator_tools.fprint函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap