コード例 #1
0
ファイル: _Team.py プロジェクト: Cophy08/py-Goldsberry
 def __init__(self, teamid, season='2014',league='NBA', datefrom='',
     dateto='', gamesegment=1, lastngames='0', location=1, measuretype=1,
     month='0', opponentteamid='0', outcome=1, paceadjust=1, permode=1,
     period='0', plusminus=1, seasonsegment=1, seasontype=1,
     vsconf=1, vsdiv=1, rank=1):
     self._url = "http://stats.nba.com/stats/teamdashboardbygeneralsplits?"
     self._api_param = {'TeamID':teamid,
                         'Season': _nbaSeason(season),
                         'LeagueID': _nbaLeague(league),
                         'DateFrom':datefrom,
                         'DateTo':dateto,
                         'GameSegment':_GameSegment(gamesegment),
                         'LastNGames':lastngames,
                         'Location':_Location(location),
                         'MeasureType': _measureType(measuretype),
                         'Month':month,
                         'OpponentTeamID':opponentteamid,
                         'Outcome':_Outcome(outcome),
                         'PaceAdjust':_PaceAdjust(paceadjust),
                         'PerMode':_PerMode(permode),
                         'Period':period,
                         'PlusMinus':_PlusMinus(plusminus),
                         'Rank':_Rank(rank),
                         'SeasonSegment':_SeasonSegment(seasonsegment),
                         'SeasonType':_SeasonType(seasontype),
                         'VsConference':_VsConference(vsconf),
                         'VsDivision':_VsDivision(vsdiv)
                         }
     self._pull = _requests.get(self._url, params=self._api_param)
コード例 #2
0
ファイル: _League.py プロジェクト: Cophy08/py-Goldsberry
 def __init__(
     self,
     stattype="Team",
     datefrom="",
     dateto="",
     gamescope=1,
     gamesegment=1,
     lastngames="0",
     league="NBA",
     location=1,
     measuretype=1,
     month="0",
     opponentteamid="0",
     outcome=1,
     paceadjust=1,
     permode=1,
     period="0",
     playerexperience=1,
     playerposition=1,
     plusminus=1,
     rank=1,
     season="2014",
     seasonsegment=1,
     seasontype=1,
     starterbench=1,
     vsconf=1,
     vsdiv=1,
 ):
     if stattype.lower() == "team":
         self._url = "http://stats.nba.com/stats/leaguedashteamstats?"
     else:
         self._url = "http://stats.nba.com/stats/leaguedashplayerstats?"
     self._api_param = {
         "DateFrom": datefrom,
         "DateTo": dateto,
         "GameScope": _GameScope(gamescope),
         "GameSegment": _GameSegment(gamesegment),
         "LastNGames": lastngames,
         "LeagueID": _nbaLeague(league),
         "Location": _Location(location),
         "MeasureType": _measureType(measuretype),
         "Month": month,
         "OpponentTeamID": opponentteamid,
         "Outcome": _Outcome(outcome),
         "PaceAdjust": _PaceAdjust(paceadjust),
         "PerMode": _PerMode(permode),
         "Period": period,
         "PlayerExperience": _PlayerExperience(playerexperience),
         "PlayerPosition": _PlayerPosition(playerposition),
         "PlusMinus": _PlusMinus(plusminus),
         "Rank": _Rank(rank),
         "Season": _nbaSeason(season),
         "SeasonSegment": _SeasonSegment(seasonsegment),
         "SeasonType": _SeasonType(seasontype),
         "StarterBench": _StarterBench(starterbench),
         "VsConference": _VsConference(vsconf),
         "VsDivision": VsDivision(vsdiv),
     }
     self._pull = _requests.get(self._url, params=self._api_param)
コード例 #3
0
ファイル: _League.py プロジェクト: Cophy08/py-Goldsberry
 def __init__(
     self,
     groupsize=5,
     gameid="",
     season=2014,
     league="NBA",
     datefrom="",
     dateto="",
     measure=1,
     month=0,
     opponentteamid=0,
     paceadjust=1,
     permode=1,
     period=0,
     plusminus=1,
     rank=1,
     seasonsegment=1,
     seasontype=1,
     vsconf=1,
     vsdiv=1,
     lastngames=0,
     location=1,
     outcome=1,
 ):
     self._url = "http://stats.nba.com/stats/leaguedashlineups?"
     self._api_param = {
         "DateFrom": datefrom,
         "DateTo": dateto,
         "GameID": gameid,
         "GameSegment": _GameSegment(gamesegment),
         "GroupQuantity": groupsize,
         "LastNGames": lastngames,
         "LeagueID": _nbaLeague(league),
         "Location": _Location(location),
         "MeasureType": _measureType(measure),
         "Month": month,
         "OpponentTeamID": opponentteamid,
         "Outcome": _Outcome(outcome),
         "PaceAdjust": _PaceAdjust(paceadjust),
         "PerMode": _PerMode(permode),
         "Period": period,
         "PlusMinus": _PlusMinus(plusminus),
         "Rank": _Rank(rank),
         "Season": _nbaSeason(season),
         "SeasonSegment": _SeasonSegment(seasonsegment),
         "SeasonType": _SeasonType(seasontype),
         "VsConference": _VsConference(vsconf),
         "VsDivision": _VsDivision(vsdiv),
     }
     self._pull = _requests.get(self._url, params=self._api_param)