How to use the cassiopeia.riotapi function in cassiopeia

To help you get started, we’ve selected a few cassiopeia examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github meraki-analytics / cassiopeia / test / integration / core / staticdata.py View on Github external
def test_versions():
    int_test_handler.test_result(riotapi.get_versions())
github meraki-analytics / cassiopeia / test / integration / core / game.py View on Github external
def test_recent_games():
    int_test_handler.test_result(riotapi.get_recent_games(riotapi.get_summoner_by_id(int_test_handler.summoner_id)))
github meraki-analytics / cassiopeia / test / integration / core / staticdata.py View on Github external
def test_champion_by_id():
    int_test_handler.test_result(riotapi.get_champion_by_id(int_test_handler.champion_id))
github meraki-analytics / cassiopeia / cassiopeia / core / championapi.py View on Github external
def get_champion_statuses(free_to_play=False):
    """
    Gets the statuses for all champions (whether they are disabled, etc.)

    Args:
        free_to_play (bool): whether to only return free champions (default False)

    Returns:
        dict: the statuses for all the champions
    """
    statuses = cassiopeia.dto.championapi.get_champion_statuses(free_to_play)

    # Always load champions since we'll be using them here
    cassiopeia.riotapi.get_champions()
    return {cassiopeia.riotapi.get_champion_by_id(champ.id): cassiopeia.type.core.champion.ChampionStatus(champ) for champ in statuses.champions}
github meraki-analytics / cassiopeia / cassiopeia / type / core / tournament.py View on Github external
def summoner(self):
        """
        Returns:
            Summoner: the summoner that triggered the event
        """
        return cassiopeia.riotapi.get_summoner_by_id(int(self.data.summonerId)) if self.data.summonerId else None
github meraki-analytics / cassiopeia / cassiopeia / type / core / matchhistory.py View on Github external
def summoner_spell_f(self):
        """SummonerSpell    the participant's second summoner spell"""
        return cassiopeia.riotapi.get_summoner_spell(self.data.participant.spell2Id) if self.data.participant.spell2Id else None
github meraki-analytics / cassiopeia / cassiopeia / type / core / summoner.py View on Github external
def champion_masteries(self):
        """
        Returns:
            datetime: the date this summoner was last modified specified as epoch milliseconds. The following events will update this timestamp: profile icon change, playing the tutorial or advanced tutorial, finishing a game, summoner name change
        """
        return cassiopeia.riotapi.get_champion_masteries(self)
github meraki-analytics / cassiopeia / cassiopeia / core / gameapi.py View on Github external
"""
    Gets the most recent games a summoner played

    Args:
        summoner (Summoner): the summoner to get recent games for

    Returns:
        list: the summoner's recent games
    """
    games = cassiopeia.dto.gameapi.get_recent_games(summoner.id)

    # Load required data if loading policy is eager
    if cassiopeia.core.requests.load_policy is cassiopeia.type.core.common.LoadPolicy.eager:
        summoner_ids = games.summoner_ids
        cassiopeia.riotapi.get_summoners_by_id(list(summoner_ids)) if summoner_ids else None
        cassiopeia.riotapi.get_summoner_spells() if games.summoner_spell_ids else None

    return [cassiopeia.type.core.game.Game(game, games.summonerId) for game in games.games]
github meraki-analytics / cassiopeia / cassiopeia / type / core / team.py View on Github external
def league_entries(self):
        """
        Returns:
            int: the team's id
        """
        return cassiopeia.riotapi.get_league_entries_by_team(self)
github meraki-analytics / cassiopeia / cassiopeia / type / core / team.py View on Github external
def match(self):
        """
        Returns:
            datetime: the date and time for the team's last game in epoch milliseconds
        """
        return cassiopeia.riotapi.get_match(self.id)