def __init__(self, leagueSlug): self.slug = leagueSlug queryData = downloadMeta('getLeagues') self.data = [league for league in queryData['data']['leagues'] if league['slug'] == leagueSlug][0] dictToAttr(self, self.data) queryData = downloadMeta('getTournamentsForLeague', {'leagueId': self.id}) self.tournaments = queryData['data']['leagues'][0]['tournaments']
def __init__(self, leagueId, tournamentId, tournamentData=[]): self.leagueId = leagueId self.id = tournamentId if not tournamentData: queryData = downloadMeta('getTournamentsForLeague', {'leagueId': leagueId}) tournamentData = [t for t in queryData['data']['leagues'][0]['tournaments'] if t['id'] == self.id][0] self.data = tournamentData dictToAttr(self, self.data) queryData = downloadMeta('getCompletedEvents', {'tournamentId': self.id}) self.events = queryData['data']['schedule']['events']
def __init__(self, tournamentId, eventId): self.tournamentId = tournamentId self.id = eventId queryData = downloadMeta('getEventDetails', {'id': eventId}) self.data = queryData['data']['event'] dictToAttr(self, self.data) self.games = self.data['match']['games']
def __init__(self, game, side): self._game = game self._side = side teamId = game.json['gameMetadata'][side+'TeamMetadata']['esportsTeamId'] queryData = downloadMeta('getTeams', params={'id': teamId}) teamData = queryData['data']['teams'][0] dictToAttr(self, teamData) self.data = _pd.DataFrame([frame[side + 'Team'] for frame in game.json['frames']]) self.top = Participant(self, 'top') self.jungle = Participant(self, 'jungle') self.mid = Participant(self, 'mid') self.bottom = Participant(self, 'bottom') self.support = Participant(self, 'support') self.data.drop(columns='participants')
def __init__(self, eventId, gameId, gameData=[], autoLoad=True): self.eventId = eventId self.id = gameId if not gameData: queryData = downloadMeta('getEventDetails', {'id': eventId}) teamData = queryData['data']['event']['match']['teams'] gameData = { 'winner': [team['name'] for team in teamData if team['result']['gameWins'] == 1][0], 'teams': teamData } dictToAttr(self, gameData) if autoLoad: try: self.loadData() self.parseData() except AssertionError: pass