diff --git a/cassiopeia/baseriotapi.py b/cassiopeia/baseriotapi.py index ecf26e14..27fada94 100644 --- a/cassiopeia/baseriotapi.py +++ b/cassiopeia/baseriotapi.py @@ -14,7 +14,6 @@ from cassiopeia.dto.statusapi import * from cassiopeia.dto.matchapi import * from cassiopeia.dto.matchlistapi import * -from cassiopeia.dto.matchhistoryapi import * from cassiopeia.dto.statsapi import * from cassiopeia.dto.summonerapi import * from cassiopeia.dto.teamapi import * diff --git a/cassiopeia/core/matchapi.py b/cassiopeia/core/matchapi.py index dff6066a..2287d246 100644 --- a/cassiopeia/core/matchapi.py +++ b/cassiopeia/core/matchapi.py @@ -40,7 +40,7 @@ def get_matches(ids, include_timeline=True): """Gets a bunch of matches ids list | list the IDs of or references to the matches to get - include_timeline bool whether to include timeline data in the returned match + include_timeline bool whether to include timeline data in the returned matches return list the matches """ diff --git a/cassiopeia/core/matchhistoryapi.py b/cassiopeia/core/matchhistoryapi.py deleted file mode 100644 index 4850d4f3..00000000 --- a/cassiopeia/core/matchhistoryapi.py +++ /dev/null @@ -1,40 +0,0 @@ -import cassiopeia.riotapi -import cassiopeia.dto.matchhistoryapi -import cassiopeia.core.requests -import cassiopeia.type.core.common -import cassiopeia.type.core.matchhistory - -def get_match_history(summoner, begin_index=0, champions=None, ranked_queues=None): - """Gets a summoner's match history - - summoner Summoner the summoner to get match history for - begin_index int the game index to start from (default 0) - champions Champion | list the champion(s) to limit the results to (default None) - ranked_queue Queue | list the ranked queue(s) to limit the results to (default None) - - return list the summoner's match history - """ - if(ranked_queues): - for queue in ranked_queues: - if queue not in cassiopeia.type.core.common.ranked_queues: - raise ValueError("{queue} is not a ranked queue".format(queue=queue)) - - # Convert core types to API-ready types - champion_ids = [champion.id for champion in champions] if champions else None - queues = [queue.value for queue in ranked_queues] if ranked_queues else None - - history = cassiopeia.dto.matchhistoryapi.get_match_history(summoner.id, begin_index, champion_ids, queues) - - # Load required data if loading policy is eager - if(cassiopeia.core.requests.load_policy is cassiopeia.type.core.common.LoadPolicy.eager): - cassiopeia.riotapi.get_items() if history.item_ids else None - cassiopeia.riotapi.get_champions() if history.champion_ids else None - cassiopeia.riotapi.get_masteries() if history.mastery_ids else None - cassiopeia.riotapi.get_runes() if history.rune_ids else None - summoner_ids = history.summoner_ids - cassiopeia.riotapi.get_summoners_by_id(list(summoner_ids)) if summoner_ids else None - cassiopeia.riotapi.get_summoner_spells() if history.summoner_spell_ids else None - - result = [cassiopeia.type.core.matchhistory.MatchSummary(summary) for summary in history.matches] - result.reverse() - return result \ No newline at end of file diff --git a/cassiopeia/dto/matchhistoryapi.py b/cassiopeia/dto/matchhistoryapi.py deleted file mode 100644 index c4a046b5..00000000 --- a/cassiopeia/dto/matchhistoryapi.py +++ /dev/null @@ -1,25 +0,0 @@ -import cassiopeia.dto.requests -import cassiopeia.type.dto.matchhistory - -def get_match_history(summoner_id, begin_index=0, champion_ids=None, ranked_queues=None): - """https://developer.riotgames.com/api/methods#!/1012/3438 - - summoner_id int the ID of the summoner to get the match history for - begin_index int the game index to start from (default 0) - champion_ids int | list the champion ID(s) to limit the results to (default None) - ranked_queues str | list the ranked queue(s) to limit the results to ("RANKED_SOLO_5x5", "RANKED_TEAM_3x3", "RANKED_TEAM_5x5") (default None) - - return PlayerHistory the summoner's match history - """ - request = "{version}/matchhistory/{summoner_id}".format(version=cassiopeia.dto.requests.api_versions["matchhistory"], summoner_id=summoner_id) - - params = { - "beginIndex": begin_index, - "endIndex": begin_index + 15 - } - if(champion_ids): - params["championIds"] = ",".join(champion_ids) if isinstance(champion_ids, list) else str(champion_ids) - if(ranked_queues): - params["rankedQueues"] = ",".join(ranked_queues) if isinstance(ranked_queues, list) else str(ranked_queues) - - return cassiopeia.type.dto.matchhistory.PlayerHistory(cassiopeia.dto.requests.get(request, params)) \ No newline at end of file diff --git a/cassiopeia/dto/requests.py b/cassiopeia/dto/requests.py index a17dce58..6dfb4c40 100644 --- a/cassiopeia/dto/requests.py +++ b/cassiopeia/dto/requests.py @@ -19,7 +19,6 @@ "staticdata": "v1.2", "status": "v1.0", "match": "v2.2", - "matchhistory": "v2.2", "matchlist": "v2.2", "stats": "v1.3", "summoner": "v1.4", diff --git a/cassiopeia/riotapi.py b/cassiopeia/riotapi.py index 194aba2c..c54069c9 100644 --- a/cassiopeia/riotapi.py +++ b/cassiopeia/riotapi.py @@ -14,7 +14,6 @@ from cassiopeia.core.leagueapi import * from cassiopeia.core.matchapi import * from cassiopeia.core.matchlistapi import * -from cassiopeia.core.matchhistoryapi import * from cassiopeia.core.staticdataapi import * from cassiopeia.core.statusapi import * from cassiopeia.core.statsapi import * diff --git a/cassiopeia/type/api/store.py b/cassiopeia/type/api/store.py index d44e2f7f..b504bebe 100644 --- a/cassiopeia/type/api/store.py +++ b/cassiopeia/type/api/store.py @@ -256,14 +256,13 @@ def _sa_bind_typesystem(): if(__sa_bound): return - import cassiopeia.type.dto.champion, cassiopeia.type.dto.currentgame, cassiopeia.type.dto.featuredgames, cassiopeia.type.dto.game, cassiopeia.type.dto.league, cassiopeia.type.dto.match, cassiopeia.type.dto.matchhistory, cassiopeia.type.dto.matchlist, cassiopeia.type.dto.staticdata, cassiopeia.type.dto.stats, cassiopeia.type.dto.status, cassiopeia.type.dto.summoner, cassiopeia.type.dto.team + import cassiopeia.type.dto.champion, cassiopeia.type.dto.currentgame, cassiopeia.type.dto.featuredgames, cassiopeia.type.dto.game, cassiopeia.type.dto.league, cassiopeia.type.dto.match, cassiopeia.type.dto.matchlist, cassiopeia.type.dto.staticdata, cassiopeia.type.dto.stats, cassiopeia.type.dto.status, cassiopeia.type.dto.summoner, cassiopeia.type.dto.team cassiopeia.type.dto.champion._sa_bind_all() cassiopeia.type.dto.currentgame._sa_bind_all() cassiopeia.type.dto.featuredgames._sa_bind_all() cassiopeia.type.dto.game._sa_bind_all() cassiopeia.type.dto.league._sa_bind_all() cassiopeia.type.dto.match._sa_bind_all() - cassiopeia.type.dto.matchhistory._sa_bind_all() cassiopeia.type.dto.matchlist._sa_bind_all() cassiopeia.type.dto.staticdata._sa_bind_all() cassiopeia.type.dto.stats._sa_bind_all() @@ -271,14 +270,13 @@ def _sa_bind_typesystem(): cassiopeia.type.dto.summoner._sa_bind_all() cassiopeia.type.dto.team._sa_bind_all() - import cassiopeia.type.core.champion, cassiopeia.type.core.currentgame, cassiopeia.type.core.featuredgames, cassiopeia.type.core.game, cassiopeia.type.core.league, cassiopeia.type.core.match, cassiopeia.type.core.matchhistory, cassiopeia.type.core.matchlist, cassiopeia.type.core.staticdata, cassiopeia.type.core.stats, cassiopeia.type.core.status, cassiopeia.type.core.summoner, cassiopeia.type.core.team + import cassiopeia.type.core.champion, cassiopeia.type.core.currentgame, cassiopeia.type.core.featuredgames, cassiopeia.type.core.game, cassiopeia.type.core.league, cassiopeia.type.core.match, cassiopeia.type.core.matchlist, cassiopeia.type.core.staticdata, cassiopeia.type.core.stats, cassiopeia.type.core.status, cassiopeia.type.core.summoner, cassiopeia.type.core.team cassiopeia.type.core.champion._sa_rebind_all() cassiopeia.type.core.currentgame._sa_rebind_all() cassiopeia.type.core.featuredgames._sa_rebind_all() cassiopeia.type.core.game._sa_rebind_all() cassiopeia.type.core.league._sa_rebind_all() cassiopeia.type.core.match._sa_rebind_all() - cassiopeia.type.core.matchhistory._sa_rebind_all() cassiopeia.type.core.matchlist._sa_rebind_all() cassiopeia.type.core.staticdata._sa_rebind_all() cassiopeia.type.core.stats._sa_rebind_all() diff --git a/cassiopeia/type/core/matchhistory.py b/cassiopeia/type/core/matchhistory.py deleted file mode 100644 index 4802be9f..00000000 --- a/cassiopeia/type/core/matchhistory.py +++ /dev/null @@ -1,705 +0,0 @@ -import datetime - -import cassiopeia.riotapi -import cassiopeia.type.dto.common -import cassiopeia.type.core.common -import cassiopeia.type.dto.matchhistory - -@cassiopeia.type.core.common.inheritdocs -class MatchSummary(cassiopeia.type.core.common.CassiopeiaObject): - dto_type = cassiopeia.type.dto.matchhistory.MatchSummary - - def __str__(self): - return "Match {id} Summary".format(id=self.id) - - def __iter__(self): - return iter(self.participants) - - def __len__(self): - return len(self.participants) - - def __getitem__(self, index): - return self.participants[index] - - def __eq__(self, other): - return self.id == other.id - - def __ne__(self, other): - return self.id != other.id - - def __hash__(self): - return hash(self.id) - - @cassiopeia.type.core.common.immutablemethod - def match(self): - """Gets the full information for this match - - return Match the match - """ - return cassiopeia.riotapi.get_match(self.id) - - @property - def map(self): - """Map the map the match was played on""" - return cassiopeia.type.core.common.Map(self.data.mapId) if self.data.mapId else None - - @cassiopeia.type.core.common.lazyproperty - def creation(self): - """datetime when the match was created""" - return datetime.datetime.utcfromtimestamp(self.data.matchCreation / 1000) if self.data.matchCreation else None - - @cassiopeia.type.core.common.lazyproperty - def duration(self): - """datetime duration of the match""" - return datetime.timedelta(seconds=self.data.matchDuration) - - @property - def id(self): - """int the match ID""" - return self.data.matchId - - @property - def mode(self): - """GameMode the game mode of the match""" - return cassiopeia.type.core.common.GameMode(self.data.matchMode) if self.data.matchMode else None - - @property - def type(self): - """GameType the game type""" - return cassiopeia.type.core.common.GameType(self.data.matchType) if self.data.matchType else None - - @property - def version(self): - """str the patch this match was played in""" - return self.data.matchVersion - - @cassiopeia.type.core.common.lazyproperty - def participants(self): - """list the participants in this match""" - participants = [] - for i in range(len(self.data.participants)): - p = CombinedParticipant(self.data.participants[i], self.data.participantIdentities[i]) - participants.append(Participant(p)) - return sorted(participants, key=lambda p: p.id) - - @property - def platform(self): - """Platform the platform (ie server) for this match""" - return cassiopeia.type.core.common.Platform(self.data.platformId) if self.data.platformId else None - - @property - def queue(self): - """Queue the queue type for this match""" - return cassiopeia.type.core.common.Queue(self.data.queueType) if self.data.queueType else None - - @property - def region(self): - """Region the region the match was played in""" - return cassiopeia.type.core.common.Region(self.data.region) if self.data.region else None - - @property - def season(self): - """Season the season this match was played in""" - return cassiopeia.type.core.common.Season(self.data.season) if self.data.season else None - - -@cassiopeia.type.core.common.inheritdocs -class CombinedParticipant(cassiopeia.type.dto.common.CassiopeiaDto): - def __init__(self, participant, identity): - self.participant = participant - self.identity = identity - - -@cassiopeia.type.core.common.inheritdocs -class Participant(cassiopeia.type.core.common.CassiopeiaObject): - dto_type = CombinedParticipant - - def __str__(self): - return "{player} ({champ})".format(player=self.summoner, champ=self.champion) - - @property - def champion(self): - """Champion the champion this participant played""" - return cassiopeia.riotapi.get_champion_by_id(self.data.participant.championId) if self.data.participant.championId else None - - @property - def previous_season_tier(self): - """Tier the participant's tier last season""" - return cassiopeia.type.core.common.Tier(self.data.participant.highestAchievedSeasonTier) if self.data.participant.highestAchievedSeasonTier else None - - @cassiopeia.type.core.common.lazyproperty - def masteries(self): - """list the participant's masteries""" - masteries = [] - ranks = [] - for mastery in self.data.participant.masteries: - masteries.append(mastery.masteryId) - ranks.append(mastery.rank) - return dict(zip(cassiopeia.riotapi.get_masteries(masteries), ranks)) - - @property - def id(self): - """int the participant ID""" - return self.data.participant.participantId - - @cassiopeia.type.core.common.lazyproperty - def runes(self): - """list the participant's current runes""" - runes = [] - counts = [] - for rune in self.data.participant.runes: - runes.append(rune.runeId) - counts.append(rune.rank) - return dict(zip(cassiopeia.riotapi.get_runes(runes), counts)) - - @property - def summoner_spell_d(self): - """SummonerSpell the participant's first summoner spell""" - return cassiopeia.riotapi.get_summoner_spell(self.data.participant.spell1Id) if self.data.participant.spell1Id else None - - @property - 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 - - @property - def stats(self): - """ParticipantStats the participant's stats""" - return ParticipantStats(self.data.participant.stats) if self.data.participant.stats else None - - @property - def side(self): - """Side the side this participant was on""" - return cassiopeia.type.core.common.Side(self.data.participant.teamId) if self.data.participant.teamId else None - - @cassiopeia.type.core.common.lazyproperty - def timeline(self): - """ParticipantTimeline the participant's timeline""" - return ParticipantTimeline(self.data.participant.timeline) if self.data.participant.timeline else None - - @property - def match_history_uri(self): - """str the the URI to access this player's match history online""" - return self.data.identity.player.matchHistoryUri - - @property - def summoner(self): - """Summoner the summoner associated with this participant""" - return cassiopeia.riotapi.get_summoner_by_id(self.data.identity.player.summonerId) if self.data.identity.player and self.data.identity.player.summonerId else None - - -@cassiopeia.type.core.common.inheritdocs -class ParticipantStats(cassiopeia.type.core.common.CassiopeiaObject): - dto_type = cassiopeia.type.dto.matchhistory.ParticipantStats - - def __str__(self): - return "Participant Stats" - - @property - def kda(self): - """float the participant's kda""" - return (self.kills + self.assists) / (self.deaths if self.deaths else 1) - - @property - def assists(self): - """int the total number of assists this participant had""" - return self.data.assists - - @property - def champion_level(self): - """int the champion level of the participant when the game ended""" - return self.data.champLevel - - @property - def combat_score(self): - """int dominion only. the part of the participant's score that came from combat-related activities""" - return self.data.combatPlayerScore - - @property - def deaths(self): - """int the number of deaths this participant had""" - return self.data.deaths - - @property - def double_kills(self): - """int the total number of double kills this participant has had""" - return self.data.doubleKills - - @property - def first_blood_assist(self): - """bool flag indicating if participant got an assist on first blood""" - return self.data.firstBloodAssist - - @property - def first_blood(self): - """bool whether this participant got first blood""" - return self.data.firstBloodKill - - @property - def first_inhibitor_assist(self): - """bool flag indicating if participant got an assist on the first inhibitor""" - return self.data.firstInhibitorAssist - - @property - def first_inhibitor(self): - """bool flag indicating if participant destroyed the first inhibitor""" - return self.data.firstInhibitorKill - - @property - def first_turret_assist(self): - """bool flag indicating if participant got an assist on the first tower""" - return self.data.firstTowerAssist - - @property - def first_turret(self): - """bool flag indicating if participant destroyed the first tower""" - return self.data.firstTowerKill - - @property - def gold_earned(self): - """int the participant's total gold""" - return self.data.goldEarned - - @property - def gold_spent(self): - """int the participant's spent gold""" - return self.data.goldSpent - - @property - def inhibitor_kills(self): - """int the number of inhibitors this participant killed""" - return self.data.inhibitorKills - - @property - def item0(self): - """Item the participant's first item""" - return cassiopeia.riotapi.get_item(self.data.item0) if self.data.item0 else None - - @property - def item1(self): - """Item the participant's second item""" - return cassiopeia.riotapi.get_item(self.data.item1) if self.data.item1 else None - - @property - def item2(self): - """Item the participant's third item""" - return cassiopeia.riotapi.get_item(self.data.item2) if self.data.item2 else None - - @property - def item3(self): - """Item the participant's fourth item""" - return cassiopeia.riotapi.get_item(self.data.item3) if self.data.item3 else None - - @property - def item4(self): - """Item the participant's fifth item""" - return cassiopeia.riotapi.get_item(self.data.item4) if self.data.item4 else None - - @property - def item5(self): - return cassiopeia.riotapi.get_item(self.data.item5) if self.data.item5 else None - - @property - def item6(self): - """Item the participant's seventh item (i.e. their ward)""" - return cassiopeia.riotapi.get_item(self.data.item6) if self.data.item6 else None - - @property - def items(self): - """list the participant's items""" - return [self.item0, self.item1, self.item2, self.item3, self.item4, self.item5, self.item6] - - @property - def killing_sprees(self): - """int the number of killing sprees this participant had""" - return self.data.killingSprees - - @property - def kills(self): - """int the total number of champion kills this participant had""" - return self.data.kills - - @property - def largest_critical_strike(self): - """int the largest critical strike this participant had""" - return self.data.largestCriticalStrike - - @property - def largest_killing_spree(self): - """int the larges killing spree this participant had""" - return self.data.largestKillingSpree - - @property - def largest_multi_kill(self): - """int the largest multikill this participant had""" - return self.data.largestMultiKill - - @property - def magic_damage_dealt(self): - """int the total magic damage this participant dealt""" - return self.data.magicDamageDealt - - @property - def magic_damage_dealt_to_champions(self): - """int the total magic damage this participant dealt to champions""" - return self.data.magicDamageDealtToChampions - - @property - def magic_damage_taken(self): - """int the total magic damage this participant received""" - return self.data.magicDamageTaken - - @property - def minion_kills(self): - """int the number of minions this participant killed""" - return self.data.minionsKilled - - @property - def monster_kills(self): - """int neutral minions killed""" - return self.data.neutralMinionsKilled - - @property - def enemy_monster_kills(self): - """int neutral jungle minions killed in the enemy team's jungle""" - return self.data.neutralMinionsKilledEnemyJungle - - @property - def ally_monster_kills(self): - """int neutral jungle minions killed in your team's jungle""" - return self.data.neutralMinionsKilledTeamJungle - - @property - def nodes_captured(self): - """int dominion only. the number of nodes this participant captured""" - return self.data.nodeCapture - - @property - def node_capture_assists(self): - """int dominion only. the number of nodes this participant assisted in capturing""" - return self.data.nodeCaptureAssist - - @property - def node_neutralizations(self): - """int dominion only. the number of nodes this participant neutralized""" - return self.data.nodeNeutralize - - @property - def node_neutralization_assists(self): - """int dominion only. the number of nodes this participant assisted in neutralizing""" - return self.data.nodeNeutralizeAssist - - @property - def objective_score(self): - """int dominion only. the part of the participant's score that came from objective-related activities""" - return self.data.objectivePlayerScore - - @property - def penta_kills(self): - """int the number of penta kills this participant had""" - return self.data.pentaKills - - @property - def physical_damage_dealt(self): - """int the total amount of physical damage this participant has dealt""" - return self.data.physicalDamageDealt - - @property - def physical_damage_dealt_to_champions(self): - """int the total physical damage this participant dealt to champions""" - return self.data.physicalDamageDealtToChampions - - @property - def physical_damage_taken(self): - """int the total physical damage this participant received""" - return self.data.physicalDamageTaken - - # int # Number of quadra kills - @property - def quadra_kills(self): - """int the number of quadra kills this participant had""" - return self.data.quadraKills - - @property - def sight_wards_bought(self): - """int the number of sight wards this participant bought""" - return self.data.sightWardsBoughtInGame - - @property - def team_objectives(self): - """int if game was a dominion game, number of completed team objectives (i.e., quests)""" - return self.data.teamObjective - - @property - def damage_dealt(self): - """int the total damage this participant dealt""" - return self.data.totalDamageDealt - - @property - def damage_dealt_to_champions(self): - """int the total damage this participant dealt to champions""" - return self.data.totalDamageDealtToChampions - - @property - def damage_taken(self): - """int the total damage this participant received""" - return self.data.totalDamageTaken - - @property - def healing_done(self): - """int the amount of healing this participant did""" - return self.data.totalHeal - - @property - def score(self): - """int dominion only. the score for this participant""" - return self.data.totalPlayerScore - - @property - def score_rank(self): - """int if game was a dominion game, team rank of the player's total score (e.g., 1-5)""" - return self.data.totalScoreRank - - @property - def crowd_control_dealt(self): - """int the total amount of crowd control this participant dealt (in seconds)""" - return self.data.totalTimeCrowdControlDealt - - @property - def units_healed(self): - """int the number of units this participant healed""" - return self.data.totalUnitsHealed - - @property - def turret_kills(self): - """int the number of turret kills this participant had""" - return self.data.towerKills - - @property - def triple_kills(self): - """int the number of triple kills this participant had""" - return self.data.tripleKills - - @property - def true_damage_dealt(self): - """int the total true damage this participant dealth""" - return self.data.trueDamageDealt - - @property - def true_damage_dealt_to_champions(self): - """int the total damage this participant dealt to champions""" - return self.data.trueDamageDealtToChampions - - @property - def true_damage_taken(self): - """int the total true damage this participant received""" - return self.data.trueDamageTaken - - @property - def unreal_kills(self): - """int the number of unreal kills this participant had""" - return self.data.unrealKills - - @property - def vision_wards_bought(self): - """int the number of vision wards sprees this participant bought""" - return self.data.visionWardsBoughtInGame - - @property - def ward_kills(self): - """int the number of wards sprees this participant killed""" - return self.data.wardsKilled - - @property - def wards_placed(self): - """int the number of wards this participant placed""" - return self.data.wardsPlaced - - @property - def win(self): - """bool whether or not the participant won the game""" - return self.data.winner - - -@cassiopeia.type.core.common.inheritdocs -class ParticipantTimeline(cassiopeia.type.core.common.CassiopeiaObject): - dto_type = cassiopeia.type.dto.matchhistory.ParticipantTimeline - - def __str__(self): - return "Participant Timeline" - - @cassiopeia.type.core.common.lazyproperty - def ancient_golem_assists_per_min_counts(self): - """ParticipantTimelineData ancient golem assists per minute timeline counts""" - return ParticipantTimelineData(self.data.ancientGolemAssistsPerMinCounts) if self.data.ancientGolemAssistsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def ancient_golem_kills_per_min_counts(self): - """ParticipantTimelineData ancient golem kills per minute timeline counts""" - return ParticipantTimelineData(self.data.ancientGolemKillsPerMinCounts) if self.data.ancientGolemKillsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def assisted_lane_deaths_per_min_deltas(self): - """ParticipantTimelineData assisted lane deaths per minute timeline data""" - return ParticipantTimelineData(self.data.assistedLaneDeathsPerMinDeltas) if self.data.assistedLaneDeathsPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def assisted_lane_kills_per_min_deltas(self): - """ParticipantTimelineData assisted lane kills per minute timeline data""" - return ParticipantTimelineData(self.data.assistedLaneKillsPerMinDeltas) if self.data.assistedLaneKillsPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def baron_assists_per_min_counts(self): - """ParticipantTimelineData baron assists per minute timeline counts""" - return ParticipantTimelineData(self.data.baronAssistsPerMinCounts) if self.data.baronAssistsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def baron_kills_per_min_counts(self): - """ParticipantTimelineData baron kills per minute timeline counts""" - return ParticipantTimelineData(self.data.baronKillsPerMinCounts) if self.data.baronKillsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def creeps_per_min_deltas(self): - """ParticipantTimelineData creeps per minute timeline data""" - return ParticipantTimelineData(self.data.creepsPerMinDeltas) if self.data.creepsPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def cs_diff_per_min_deltas(self): - """ParticipantTimelineData creep score difference per minute timeline data""" - return ParticipantTimelineData(self.data.csDiffPerMinDeltas) if self.data.csDiffPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def damage_taken_diff_per_min_deltas(self): - """ParticipantTimelineData damage taken difference per minute timeline data""" - return ParticipantTimelineData(self.data.damageTakenDiffPerMinDeltas) if self.data.damageTakenDiffPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def damage_taken_per_min_deltas(self): - """ParticipantTimelineData damage taken per minute timeline data""" - return ParticipantTimelineData(self.data.damageTakenPerMinDeltas) if self.data.damageTakenPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def dragon_assists_per_min_counts(self): - """ParticipantTimelineData dragon assists per minute timeline counts""" - return ParticipantTimelineData(self.data.dragonAssistsPerMinCounts) if self.data.dragonAssistsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def dragon_kills_per_min_counts(self): - """ParticipantTimelineData dragon kills per minute timeline counts""" - return ParticipantTimelineData(self.data.dragonKillsPerMinCounts) if self.data.dragonKillsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def elder_lizard_assists_per_min_counts(self): - """ParticipantTimelineData elder lizard assists per minute timeline counts""" - return ParticipantTimelineData(self.data.elderLizardAssistsPerMinCounts) if self.data.elderLizardAssistsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def elder_lizard_kills_per_min_counts(self): - """ParticipantTimelineData elder lizard kills per minute timeline counts""" - return ParticipantTimelineData(self.data.elderLizardKillsPerMinCounts) if self.data.elderLizardKillsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def gold_per_min_deltas(self): - """ParticipantTimelineData gold per minute timeline data""" - return ParticipantTimelineData(self.data.goldPerMinDeltas) if self.data.goldPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def inhibitor_assists_per_min_counts(self): - """ParticipantTimelineData inhibitor assists per minute timeline counts""" - return ParticipantTimelineData(self.data.inhibitorAssistsPerMinCounts) if self.data.inhibitorAssistsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def inhibitor_kills_per_min_counts(self): - """ParticipantTimelineData inhibitor kills per minute timeline counts""" - return ParticipantTimelineData(self.data.inhibitorKillsPerMinCounts) if self.data.inhibitorKillsPerMinCounts else None - - @property - def lane(self): - """Lane the lane this participant was in""" - lane = self.data.lane - lane = "MIDDLE" if lane == "MID" else lane - lane = "BOTTOM" if lane == "BOT" else lane - return cassiopeia.type.core.common.Lane(lane) if lane else None - - @property - def role(self): - """Role the role of this particiant""" - return cassiopeia.type.core.common.Role(self.data.role) if self.data.role else None - - @cassiopeia.type.core.common.lazyproperty - def turret_assists_per_min_counts(self): - """ParticipantTimelineData tower assists per minute timeline counts""" - return ParticipantTimelineData(self.data.towerAssistsPerMinCounts) if self.data.towerAssistsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def turret_kills_per_min_counts(self): - """ParticipantTimelineData tower kills per minute timeline counts""" - return ParticipantTimelineData(self.data.towerKillsPerMinCounts) if self.data.towerKillsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def turret_Kills_per_min_deltas(self): - """ParticipantTimelineData tower kills per minute timeline data""" - return ParticipantTimelineData(self.data.towerKillsPerMinDeltas) if self.data.towerKillsPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def spider_assists_per_min_counts(self): - """ParticipantTimelineData vilemaw assists per minute timeline counts""" - return ParticipantTimelineData(self.data.vilemawAssistsPerMinCounts) if self.data.vilemawAssistsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def spider_kills_per_min_counts(self): - """ParticipantTimelineData vilemaw kills per minute timeline counts""" - return ParticipantTimelineData(self.data.vilemawKillsPerMinCounts) if self.data.vilemawKillsPerMinCounts else None - - @cassiopeia.type.core.common.lazyproperty - def wards_per_min_deltas(self): - """ParticipantTimelineData wards placed per minute timeline data""" - return ParticipantTimelineData(self.data.wardsPerMinDeltas) if self.data.wardsPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def xp_diff_per_min_deltas(self): - """ParticipantTimelineData experience difference per minute timeline data""" - return ParticipantTimelineData(self.data.xpDiffPerMinDeltas) if self.data.xpDiffPerMinDeltas else None - - @cassiopeia.type.core.common.lazyproperty - def xp_per_min_deltas(self): - """ParticipantTimelineData experience per minute timeline data""" - return ParticipantTimelineData(self.data.xpPerMinDeltas) if self.data.xpPerMinDeltas else None - - -@cassiopeia.type.core.common.inheritdocs -class ParticipantTimelineData(cassiopeia.type.core.common.CassiopeiaObject): - dto_type = cassiopeia.type.dto.matchhistory.ParticipantTimelineData - - def __str__(self): - return "Participant Timeline Data" - - @property - def ten_to_twenty(self): - """float value per minute from 10 min to 20 min""" - return self.data.tenToTwenty - - @property - def thirty_to_end(self): - """float value per minute from 30 min to the end of the game""" - return self.data.thirtyToEnd - - @property - def twenty_to_thirty(self): - """float value per minute from 20 min to 30 min""" - return self.data.twentyToThirty - - @property - def zero_to_ten(self): - """float value per minute from the beginning of the game to 10 min""" - return self.data.zeroToTen - -############################### -# Dynamic SQLAlchemy bindings # -############################### - -def _sa_rebind_all(): - MatchSummary.dto_type = cassiopeia.type.dto.matchhistory.MatchSummary - ParticipantStats.dto_type = cassiopeia.type.dto.matchhistory.ParticipantStats - ParticipantTimeline.dto_type = cassiopeia.type.dto.matchhistory.ParticipantTimeline - ParticipantTimelineData.dto_type = cassiopeia.type.dto.matchhistory.ParticipantTimelineData diff --git a/cassiopeia/type/core/summoner.py b/cassiopeia/type/core/summoner.py index 5ea065a9..06b81fa5 100644 --- a/cassiopeia/type/core/summoner.py +++ b/cassiopeia/type/core/summoner.py @@ -205,18 +205,6 @@ def teams(self): """ return cassiopeia.riotapi.get_teams_by_summoner(self) - @cassiopeia.type.core.common.immutablemethod - def match_history(self, begin_index=0, champions=None, ranked_queues=None): - """Gets the summoner's match history - - begin_index int the game index to start from (default 0) - champions Champion | list the champion(s) to limit the results to (default None) - ranked_queue Queue | list the ranked queue(s) to limit the results to (default None) - - return list the summoner's match history - """ - return cassiopeia.riotapi.get_match_history(self, begin_index, champions, ranked_queues) - @cassiopeia.type.core.common.immutablemethod def match_list(self, begin_index=-1, begin_time=0, end_time=0, champions=None, ranked_queues=None, seasons=None): """Gets the summoner's match history diff --git a/cassiopeia/type/dto/matchhistory.py b/cassiopeia/type/dto/matchhistory.py deleted file mode 100644 index 609d5cbc..00000000 --- a/cassiopeia/type/dto/matchhistory.py +++ /dev/null @@ -1,692 +0,0 @@ -import cassiopeia.type.dto.common -import cassiopeia.type.core.common - -if(cassiopeia.type.dto.common.sqlalchemy_imported): - import sqlalchemy - import sqlalchemy.orm - -@cassiopeia.type.core.common.inheritdocs -class PlayerHistory(cassiopeia.type.dto.common.CassiopeiaDto): - """ - matches list list of matches for the player - """ - def __init__(self, dictionary): - self.matches = [(MatchSummary(match) if not isinstance(match, MatchSummary) else match) for match in dictionary.get("matches", []) if match] - - @property - def champion_ids(self): - """Gets all champiopn IDs contained in this object""" - ids = set() - for m in self.matches: - ids = ids | m.champion_ids - return ids - - @property - def item_ids(self): - """Gets all item IDs contained in this object""" - ids = set() - for m in self.matches: - ids = ids | m.item_ids - return ids - - @property - def mastery_ids(self): - """Gets all mastery IDs contained in this object""" - ids = set() - for m in self.matches: - ids = ids | m.mastery_ids - return ids - - @property - def rune_ids(self): - """Gets all rune IDs contained in this object""" - ids = set() - for m in self.matches: - ids = ids | m.rune_ids - return ids - - @property - def summoner_ids(self): - """Gets all summoner IDs contained in this object""" - ids = set() - for m in self.matches: - ids = ids | m.summoner_ids - return ids - - @property - def summoner_spell_ids(self): - """Gets all summoner spell IDs contained in this object""" - ids = set() - for m in self.matches: - ids = ids | m.summoner_spell_ids - return ids - - -@cassiopeia.type.core.common.inheritdocs -class MatchSummary(cassiopeia.type.dto.common.CassiopeiaDto): - """ - mapId int match map ID - matchCreation int match creation time. Designates when the team select lobby is created and/or the match is made through match making, not when the game actually starts. - matchDuration int match duration - matchId int ID of the match - matchMode str match mode (Legal values: CLASSIC, ODIN, ARAM, TUTORIAL, ONEFORALL, ASCENSION, FIRSTBLOOD, KINGPORO) - matchType str match type (Legal values: CUSTOM_GAME, MATCHED_GAME, TUTORIAL_GAME) - matchVersion str match version - participantIdentities list participant identity information - participants list participant information - platformId str platform ID of the match - queueType str match queue type (Legal values: CUSTOM, NORMAL_5x5_BLIND, RANKED_SOLO_5x5, RANKED_PREMADE_5x5, BOT_5x5, NORMAL_3x3, RANKED_PREMADE_3x3, NORMAL_5x5_DRAFT, ODIN_5x5_BLIND, ODIN_5x5_DRAFT, BOT_ODIN_5x5, BOT_5x5_INTRO, BOT_5x5_BEGINNER, BOT_5x5_INTERMEDIATE, RANKED_TEAM_3x3, RANKED_TEAM_5x5, BOT_TT_3x3, GROUP_FINDER_5x5, ARAM_5x5, ONEFORALL_5x5, FIRSTBLOOD_1x1, FIRSTBLOOD_2x2, SR_6x6, URF_5x5, ONEFORALL_MIRRORMODE_5x5, BOT_URF_5x5, NIGHTMARE_BOT_5x5_RANK1, NIGHTMARE_BOT_5x5_RANK2, NIGHTMARE_BOT_5x5_RANK5, ASCENSION_5x5, HEXAKILL, KING_PORO_5x5, COUNTER_PICK) - region str region where the match was played - season str season match was played (Legal values: PRESEASON3, SEASON3, PRESEASON2014, SEASON2014, PRESEASON2015, SEASON2015) - """ - def __init__(self, dictionary): - self.mapId = dictionary.get("mapId", 0) - self.matchCreation = dictionary.get("matchCreation", 0) - self.matchDuration = dictionary.get("matchDuration", 0) - self.matchId = dictionary.get("matchId", 0) - self.matchMode = dictionary.get("matchMode", "") - self.matchType = dictionary.get("matchType", "") - self.matchVersion = dictionary.get("matchVersion", "") - self.participantIdentities = [(ParticipantIdentity(pi) if not isinstance(pi, ParticipantIdentity) else pi) for pi in dictionary.get("participantIdentities", []) if pi] - self.participants = [(Participant(p) if not isinstance(p, Participant) else p) for p in dictionary.get("participants", []) if p] - self.platformId = dictionary.get("platformId", "") - self.queueType = dictionary.get("queueType", "") - self.region = dictionary.get("region", "") - self.season = dictionary.get("season", "") - - @property - def item_ids(self): - """Gets all item IDs contained in this object""" - ids = set() - for p in self.participants: - s = p.stats - if(s.item0): - ids.add(s.item0) - if(s.item1): - ids.add(s.item1) - if(s.item2): - ids.add(s.item2) - if(s.item3): - ids.add(s.item3) - if(s.item4): - ids.add(s.item4) - if(s.item5): - ids.add(s.item5) - if(s.item6): - ids.add(s.item6) - return ids - - @property - def champion_ids(self): - """Gets all champion IDs contained in this object""" - ids = set() - for p in self.participants: - if(p.championId): - ids.add(p.championId) - return ids - - @property - def mastery_ids(self): - """Gets all mastery IDs contained in this object""" - ids = set() - for p in self.participants: - for m in p.masteries: - if(m.masteryId): - ids.add(m.masteryId) - return ids - - @property - def rune_ids(self): - """Gets all rune IDs contained in this object""" - ids = set() - for p in self.participants: - for r in p.runes: - if(r.runeId): - ids.add(r.runeId) - return ids - - @property - def summoner_ids(self): - """Gets all summoner IDs contained in this object""" - ids = set() - for p in self.participantIdentities: - if(p.player and p.player.summonerId): - ids.add(p.player.summonerId) - return ids - - @property - def summoner_spell_ids(self): - """Gets all summoner spell IDs contained in this object""" - ids = set() - for p in self.participants: - if(p.spell1Id): - ids.add(p.spell1Id) - if(p.spell2Id): - ids.add(p.spell2Id) - return ids - - -@cassiopeia.type.core.common.inheritdocs -class Participant(cassiopeia.type.dto.common.CassiopeiaDto): - """ - championId int champion ID - highestAchievedSeasonTier str highest ranked tier achieved for the previous season, if any, otherwise null. Used to display border in game loading screen. (Legal values: CHALLENGER, MASTER, DIAMOND, PLATINUM, GOLD, SILVER, BRONZE, UNRANKED) - masteries list list of mastery information - participantId int participant ID - runes list list of rune information - spell1Id int first summoner spell ID - spell2Id int second summoner spell ID - stats ParticipantStats participant statistics - teamId int team ID - timeline ParticipantTimeline timeline data. Delta fields refer to values for the specified period (e.g., the gold per minute over the first 10 minutes of the game versus the second 20 minutes of the game. Diffs fields refer to the deltas versus the calculated lane opponent(s). - """ - def __init__(self, dictionary): - self.championId = dictionary.get("championId", 0) - self.highestAchievedSeasonTier = dictionary.get("highestAchievedSeasonTier", "") - self.masteries = [(Mastery(m) if not isinstance(m, Mastery) else m) for m in dictionary.get("masteries", []) if m] - self.participantId = dictionary.get("participantId", 0) - self.runes = [(Rune(r) if not isinstance(r, Rune) else r) for r in dictionary.get("runes", []) if r] - self.spell1Id = dictionary.get("spell1Id", 0) - self.spell2Id = dictionary.get("spell2Id", 0) - val = dictionary.get("stats", None) - self.stats = ParticipantStats(val) if val and not isinstance(val, ParticipantStats) else val - self.teamId = dictionary.get("teamId", 0) - val = dictionary.get("timeline", None) - self.timeline = ParticipantTimeline(val) if val and not isinstance(val, ParticipantTimeline) else val - - -@cassiopeia.type.core.common.inheritdocs -class ParticipantIdentity(cassiopeia.type.dto.common.CassiopeiaDto): - """ - participantId int participant ID - player Player player information - """ - def __init__(self, dictionary): - self.participantId = dictionary.get("participantId", 0) - val = dictionary.get("player", None) - self.player = Player(val) if val and not isinstance(val, Player) else val - - -@cassiopeia.type.core.common.inheritdocs -class Mastery(cassiopeia.type.dto.common.CassiopeiaDto): - """ - masteryId int mastery ID - rank int mastery rank - """ - def __init__(self, dictionary): - self.masteryId = dictionary.get("masteryId", 0) - self.rank = dictionary.get("rank", 0) - - -@cassiopeia.type.core.common.inheritdocs -class ParticipantStats(cassiopeia.type.dto.common.CassiopeiaDto): - """ - assists int number of assists - champLevel int champion level achieved - combatPlayerScore int if game was a dominion game, player's combat score, otherwise 0 - deaths int number of deaths - doubleKills int number of double kills - firstBloodAssist bool flag indicating if participant got an assist on first blood - firstBloodKill bool flag indicating if participant got first blood - firstInhibitorAssist bool flag indicating if participant got an assist on the first inhibitor - firstInhibitorKill bool flag indicating if participant destroyed the first inhibitor - firstTowerAssist bool flag indicating if participant got an assist on the first tower - firstTowerKill bool flag indicating if participant destroyed the first tower - goldEarned int gold earned - goldSpent int gold spent - inhibitorKills int number of inhibitor kills - item0 int first item ID - item1 int second item ID - item2 int third item ID - item3 int fourth item ID - item4 int fifth item ID - item5 int sixth item ID - item6 int seventh item ID - killingSprees int number of killing sprees - kills int number of kills - largestCriticalStrike int largest critical strike - largestKillingSpree int largest killing spree - largestMultiKill int largest multi kill - magicDamageDealt int magical damage dealt - magicDamageDealtToChampions int magical damage dealt to champions - magicDamageTaken int magic damage taken - minionsKilled int minions killed - neutralMinionsKilled int neutral minions killed - neutralMinionsKilledEnemyJungle int neutral jungle minions killed in the enemy team's jungle - neutralMinionsKilledTeamJungle int neutral jungle minions killed in your team's jungle - nodeCapture int if game was a dominion game, number of node captures - nodeCaptureAssist int if game was a dominion game, number of node capture assists - nodeNeutralize int if game was a dominion game, number of node neutralizations - nodeNeutralizeAssist int if game was a dominion game, number of node neutralization assists - objectivePlayerScore int if game was a dominion game, player's objectives score, otherwise 0 - pentaKills int number of penta kills - physicalDamageDealt int physical damage dealt - physicalDamageDealtToChampions int physical damage dealt to champions - physicalDamageTaken int physical damage taken - quadraKills int number of quadra kills - sightWardsBoughtInGame int sight wards purchased - teamObjective int if game was a dominion game, number of completed team objectives (i.e., quests) - totalDamageDealt int total damage dealt - totalDamageDealtToChampions int total damage dealt to champions - totalDamageTaken int total damage taken - totalHeal int total heal amount - totalPlayerScore int if game was a dominion game, player's total score, otherwise 0 - totalScoreRank int if game was a dominion game, team rank of the player's total score (e.g., 1-5) - totalTimeCrowdControlDealt int total dealt crowd control time - totalUnitsHealed int total units healed - towerKills int number of tower kills - tripleKills int number of triple kills - trueDamageDealt int true damage dealt - trueDamageDealtToChampions int true damage dealt to champions - trueDamageTaken int true damage taken - unrealKills int number of unreal kills - visionWardsBoughtInGame int vision wards purchased - wardsKilled int number of wards killed - wardsPlaced int number of wards placed - winner bool flag indicating whether or not the participant won - """ - def __init__(self, dictionary): - self.assists = dictionary.get("assists", 0) - self.champLevel = dictionary.get("champLevel", 0) - self.combatPlayerScore = dictionary.get("combatPlayerScore", 0) - self.deaths = dictionary.get("deaths", 0) - self.doubleKills = dictionary.get("doubleKills", 0) - self.firstBloodAssist = dictionary.get("firstBloodAssist", False) - self.firstBloodKill = dictionary.get("firstBloodKill", False) - self.firstInhibitorAssist = dictionary.get("firstInhibitorAssist", False) - self.firstInhibitorKill = dictionary.get("firstInhibitorKill", False) - self.firstTowerAssist = dictionary.get("firstTowerAssist", False) - self.firstTowerKill = dictionary.get("firstTowerKill", False) - self.goldEarned = dictionary.get("goldEarned", 0) - self.goldSpent = dictionary.get("goldSpent", 0) - self.inhibitorKills = dictionary.get("inhibitorKills", 0) - self.item0 = dictionary.get("item0", 0) - self.item1 = dictionary.get("item1", 0) - self.item2 = dictionary.get("item2", 0) - self.item3 = dictionary.get("item3", 0) - self.item4 = dictionary.get("item4", 0) - self.item5 = dictionary.get("item5", 0) - self.item6 = dictionary.get("item6", 0) - self.killingSprees = dictionary.get("killingSprees", 0) - self.kills = dictionary.get("kills", 0) - self.largestCriticalStrike = dictionary.get("largestCriticalStrike", 0) - self.largestKillingSpree = dictionary.get("largestKillingSpree", 0) - self.largestMultiKill = dictionary.get("largestMultiKill", 0) - self.magicDamageDealt = dictionary.get("magicDamageDealt", 0) - self.magicDamageDealtToChampions = dictionary.get("magicDamageDealtToChampions", 0) - self.magicDamageTaken = dictionary.get("magicDamageTaken", 0) - self.minionsKilled = dictionary.get("minionsKilled", 0) - self.neutralMinionsKilled = dictionary.get("neutralMinionsKilled", 0) - self.neutralMinionsKilledEnemyJungle = dictionary.get("neutralMinionsKilledEnemyJungle", 0) - self.neutralMinionsKilledTeamJungle = dictionary.get("neutralMinionsKilledTeamJungle", 0) - self.nodeCapture = dictionary.get("nodeCapture", 0) - self.nodeCaptureAssist = dictionary.get("nodeCaptureAssist", 0) - self.nodeNeutralize = dictionary.get("nodeNeutralize", 0) - self.nodeNeutralizeAssist = dictionary.get("nodeNeutralizeAssist", 0) - self.objectivePlayerScore = dictionary.get("objectivePlayerScore", 0) - self.pentaKills = dictionary.get("pentaKills", 0) - self.physicalDamageDealt = dictionary.get("physicalDamageDealt", 0) - self.physicalDamageDealtToChampions = dictionary.get("physicalDamageDealtToChampions", 0) - self.physicalDamageTaken = dictionary.get("physicalDamageTaken", 0) - self.quadraKills = dictionary.get("quadraKills", 0) - self.sightWardsBoughtInGame = dictionary.get("sightWardsBoughtInGame", 0) - self.teamObjective = dictionary.get("teamObjective", 0) - self.totalDamageDealt = dictionary.get("totalDamageDealt", 0) - self.totalDamageDealtToChampions = dictionary.get("totalDamageDealtToChampions", 0) - self.totalDamageTaken = dictionary.get("totalDamageTaken", 0) - self.totalHeal = dictionary.get("totalHeal", 0) - self.totalPlayerScore = dictionary.get("totalPlayerScore", 0) - self.totalScoreRank = dictionary.get("totalScoreRank", 0) - self.totalTimeCrowdControlDealt = dictionary.get("totalTimeCrowdControlDealt", 0) - self.totalUnitsHealed = dictionary.get("totalUnitsHealed", 0) - self.towerKills = dictionary.get("towerKills", 0) - self.tripleKills = dictionary.get("tripleKills", 0) - self.trueDamageDealt = dictionary.get("trueDamageDealt", 0) - self.trueDamageDealtToChampions = dictionary.get("trueDamageDealtToChampions", 0) - self.trueDamageTaken = dictionary.get("trueDamageTaken", 0) - self.unrealKills = dictionary.get("unrealKills", 0) - self.visionWardsBoughtInGame = dictionary.get("visionWardsBoughtInGame", 0) - self.wardsKilled = dictionary.get("wardsKilled", 0) - self.wardsPlaced = dictionary.get("wardsPlaced", 0) - self.winner = dictionary.get("winner", False) - - -@cassiopeia.type.core.common.inheritdocs -class ParticipantTimeline(cassiopeia.type.dto.common.CassiopeiaDto): - """ - ancientGolemAssistsPerMinCounts ParticipantTimelineData ancient golem assists per minute timeline counts - ancientGolemKillsPerMinCounts ParticipantTimelineData ancient golem kills per minute timeline counts - assistedLaneDeathsPerMinDeltas ParticipantTimelineData assisted lane deaths per minute timeline data - assistedLaneKillsPerMinDeltas ParticipantTimelineData assisted lane kills per minute timeline data - baronAssistsPerMinCounts ParticipantTimelineData baron assists per minute timeline counts - baronKillsPerMinCounts ParticipantTimelineData baron kills per minute timeline counts - creepsPerMinDeltas ParticipantTimelineData creeps per minute timeline data - csDiffPerMinDeltas ParticipantTimelineData creep score difference per minute timeline data - damageTakenDiffPerMinDeltas ParticipantTimelineData damage taken difference per minute timeline data - damageTakenPerMinDeltas ParticipantTimelineData damage taken per minute timeline data - dragonAssistsPerMinCounts ParticipantTimelineData dragon assists per minute timeline counts - dragonKillsPerMinCounts ParticipantTimelineData dragon kills per minute timeline counts - elderLizardAssistsPerMinCounts ParticipantTimelineData elder lizard assists per minute timeline counts - elderLizardKillsPerMinCounts ParticipantTimelineData elder lizard kills per minute timeline counts - goldPerMinDeltas ParticipantTimelineData gold per minute timeline data - inhibitorAssistsPerMinCounts ParticipantTimelineData inhibitor assists per minute timeline counts - inhibitorKillsPerMinCounts ParticipantTimelineData inhibitor kills per minute timeline counts - lane str participant's lane (Legal values: MID, MIDDLE, TOP, JUNGLE, BOT, BOTTOM) - role str participant's role (Legal values: DUO, NONE, SOLO, DUO_CARRY, DUO_SUPPORT) - towerAssistsPerMinCounts ParticipantTimelineData tower assists per minute timeline counts - towerKillsPerMinCounts ParticipantTimelineData tower kills per minute timeline counts - towerKillsPerMinDeltas ParticipantTimelineData tower kills per minute timeline data - vilemawAssistsPerMinCounts ParticipantTimelineData vilemaw assists per minute timeline counts - vilemawKillsPerMinCounts ParticipantTimelineData vilemaw kills per minute timeline counts - wardsPerMinDeltas ParticipantTimelineData wards placed per minute timeline data - xpDiffPerMinDeltas ParticipantTimelineData experience difference per minute timeline data - xpPerMinDeltas ParticipantTimelineData experience per minute timeline data - """ - def __init__(self, dictionary): - val = dictionary.get("ancientGolemAssistsPerMinCounts", None) - self.ancientGolemAssistsPerMinCounts = ParticipantTimelineData(val, "ancientGolemAssistsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("ancientGolemKillsPerMinCounts", None) - self.ancientGolemKillsPerMinCounts = ParticipantTimelineData(val, "ancientGolemKillsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("assistedLaneDeathsPerMinDeltas", None) - self.assistedLaneDeathsPerMinDeltas = ParticipantTimelineData(val, "assistedLaneDeathsPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("assistedLaneKillsPerMinDeltas", None) - self.assistedLaneKillsPerMinDeltas = ParticipantTimelineData(val, "assistedLaneKillsPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("baronAssistsPerMinCounts", None) - self.baronAssistsPerMinCounts = ParticipantTimelineData(val, "baronAssistsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("baronKillsPerMinCounts", None) - self.baronKillsPerMinCounts = ParticipantTimelineData(val, "baronKillsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("creepsPerMinDeltas", None) - self.creepsPerMinDeltas = ParticipantTimelineData(val, "creepsPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("csDiffPerMinDeltas", None) - self.csDiffPerMinDeltas = ParticipantTimelineData(val, "csDiffPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("damageTakenDiffPerMinDeltas", None) - self.damageTakenDiffPerMinDeltas = ParticipantTimelineData(val, "damageTakenDiffPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("damageTakenPerMinDeltas", None) - self.damageTakenPerMinDeltas = ParticipantTimelineData(val, "damageTakenPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("dragonAssistsPerMinCounts", None) - self.dragonAssistsPerMinCounts = ParticipantTimelineData(val, "dragonAssistsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("dragonKillsPerMinCounts", None) - self.dragonKillsPerMinCounts = ParticipantTimelineData(val, "dragonKillsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("elderLizardAssistsPerMinCounts", None) - self.elderLizardAssistsPerMinCounts = ParticipantTimelineData(val, "elderLizardAssistsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("elderLizardKillsPerMinCounts", None) - self.elderLizardKillsPerMinCounts = ParticipantTimelineData(val, "elderLizardKillsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("goldPerMinDeltas", None) - self.goldPerMinDeltas = ParticipantTimelineData(val, "goldPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("inhibitorAssistsPerMinCounts", None) - self.inhibitorAssistsPerMinCounts = ParticipantTimelineData(val, "inhibitorAssistsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("inhibitorKillsPerMinCounts", None) - self.inhibitorKillsPerMinCounts = ParticipantTimelineData(val, "inhibitorKillsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - self.lane = dictionary.get("lane", "") - self.role = dictionary.get("role", "") - val = dictionary.get("towerAssistsPerMinCounts", None) - self.towerAssistsPerMinCounts = ParticipantTimelineData(val, "towerAssistsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("towerKillsPerMinCounts", None) - self.towerKillsPerMinCounts = ParticipantTimelineData(val, "towerKillsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("towerKillsPerMinDeltas", None) - self.towerKillsPerMinDeltas = ParticipantTimelineData(val, "towerKillsPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("vilemawAssistsPerMinCounts", None) - self.vilemawAssistsPerMinCounts = ParticipantTimelineData(val, "vilemawAssistsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("vilemawKillsPerMinCounts", None) - self.vilemawKillsPerMinCounts = ParticipantTimelineData(val, "vilemawKillsPerMinCounts") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("wardsPerMinDeltas", None) - self.wardsPerMinDeltas = ParticipantTimelineData(val, "wardsPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("xpDiffPerMinDeltas", None) - self.xpDiffPerMinDeltas = ParticipantTimelineData(val, "xpDiffPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - val = dictionary.get("xpPerMinDeltas", None) - self.xpPerMinDeltas = ParticipantTimelineData(val, "xpPerMinDeltas") if val and not isinstance(val, ParticipantTimelineData) else val - - -@cassiopeia.type.core.common.inheritdocs -class Rune(cassiopeia.type.dto.common.CassiopeiaDto): - """ - rank int rune rank - runeId int rune ID - """ - def __init__(self, dictionary): - self.rank = dictionary.get("rank", 0) - self.runeId = dictionary.get("runeId", 0) - - -@cassiopeia.type.core.common.inheritdocs -class Player(cassiopeia.type.dto.common.CassiopeiaDto): - """ - matchHistoryUri str match history URI - profileIcon int profile icon ID - summonerId int summoner ID - summonerName str summoner name - """ - def __init__(self, dictionary): - self.matchHistoryUri = dictionary.get("matchHistoryUri", "") - self.profileIcon = dictionary.get("profileIcon", 0) - self.summonerId = dictionary.get("summonerId", 0) - self.summonerName = dictionary.get("summonerName", "") - - -@cassiopeia.type.core.common.inheritdocs -class ParticipantTimelineData(cassiopeia.type.dto.common.CassiopeiaDto): - """ - tenToTwenty float value per minute from 10 min to 20 min - thirtyToEnd float value per minute from 30 min to the end of the game - twentyToThirty float value per minute from 20 min to 30 min - zeroToTen float value per minute from 20 min to 30 min - """ - def __init__(self, dictionary, type_=None): - self.tenToTwenty = dictionary.get("tenToTwenty", 0.0) - self.thirtyToEnd = dictionary.get("thirtyToEnd", 0.0) - self.twentyToThirty = dictionary.get("twentyToThirty", 0.0) - self.zeroToTen = dictionary.get("zeroToTen", 0.0) - self._type = type_ - -############################### -# Dynamic SQLAlchemy bindings # -############################### - -def _sa_bind_match_summary(): - global MatchSummary - @cassiopeia.type.core.common.inheritdocs - class MatchSummary(MatchSummary, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryMatch" - mapId = sqlalchemy.Column(sqlalchemy.Integer) - matchCreation = sqlalchemy.Column(sqlalchemy.BigInteger) - matchDuration = sqlalchemy.Column(sqlalchemy.Integer) - matchId = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - matchMode = sqlalchemy.Column(sqlalchemy.String(30)) - matchType = sqlalchemy.Column(sqlalchemy.String(30)) - matchVersion = sqlalchemy.Column(sqlalchemy.String(30)) - participantIdentities = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantIdentity", cascade="all, delete-orphan", passive_deletes=True) - participants = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.Participant", cascade="all, delete-orphan", passive_deletes=True) - platformId = sqlalchemy.Column(sqlalchemy.String(30)) - queueType = sqlalchemy.Column(sqlalchemy.String(30)) - region = sqlalchemy.Column(sqlalchemy.String(30)) - season = sqlalchemy.Column(sqlalchemy.String(30)) - -def _sa_bind_participant(): - global Participant - @cassiopeia.type.core.common.inheritdocs - class Participant(Participant, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryParticipant" - championId = sqlalchemy.Column(sqlalchemy.Integer) - highestAchievedSeasonTier = sqlalchemy.Column(sqlalchemy.String(30)) - masteries = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.Mastery", cascade="all, delete-orphan", passive_deletes=True) - participantId = sqlalchemy.Column(sqlalchemy.Integer) - runes = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.Rune", cascade="all, delete-orphan", passive_deletes=True) - spell1Id = sqlalchemy.Column(sqlalchemy.Integer) - spell2Id = sqlalchemy.Column(sqlalchemy.Integer) - stats = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantStats", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - teamId = sqlalchemy.Column(sqlalchemy.Integer) - timeline = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimeline", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - _id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - _match_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("HistoryMatch.matchId", ondelete="CASCADE")) - -def _sa_bind_participant_identity(): - global ParticipantIdentity - @cassiopeia.type.core.common.inheritdocs - class ParticipantIdentity(ParticipantIdentity, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryParticipantIdentity" - participantId = sqlalchemy.Column(sqlalchemy.Integer) - player = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.Player", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - _id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - _match_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("HistoryMatch.matchId", ondelete="CASCADE")) - -def _sa_bind_mastery(): - global Mastery - @cassiopeia.type.core.common.inheritdocs - class Mastery(Mastery, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryMastery" - masteryId = sqlalchemy.Column(sqlalchemy.Integer) - rank = sqlalchemy.Column(sqlalchemy.Integer) - _id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - _participant_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("HistoryParticipant._id", ondelete="CASCADE")) - -def _sa_bind_participant_stats(): - global ParticipantStats - @cassiopeia.type.core.common.inheritdocs - class ParticipantStats(ParticipantStats, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryParticipantStats" - assists = sqlalchemy.Column(sqlalchemy.Integer) - champLevel = sqlalchemy.Column(sqlalchemy.Integer) - combatPlayerScore = sqlalchemy.Column(sqlalchemy.Integer) - deaths = sqlalchemy.Column(sqlalchemy.Integer) - doubleKills = sqlalchemy.Column(sqlalchemy.Integer) - firstBloodAssist = sqlalchemy.Column(sqlalchemy.Boolean) - firstBloodKill = sqlalchemy.Column(sqlalchemy.Boolean) - firstInhibitorAssist = sqlalchemy.Column(sqlalchemy.Boolean) - firstInhibitorKill = sqlalchemy.Column(sqlalchemy.Boolean) - firstTowerAssist = sqlalchemy.Column(sqlalchemy.Boolean) - firstTowerKill = sqlalchemy.Column(sqlalchemy.Boolean) - goldEarned = sqlalchemy.Column(sqlalchemy.Integer) - goldSpent = sqlalchemy.Column(sqlalchemy.Integer) - inhibitorKills = sqlalchemy.Column(sqlalchemy.Integer) - item0 = sqlalchemy.Column(sqlalchemy.Integer) - item1 = sqlalchemy.Column(sqlalchemy.Integer) - item2 = sqlalchemy.Column(sqlalchemy.Integer) - item3 = sqlalchemy.Column(sqlalchemy.Integer) - item4 = sqlalchemy.Column(sqlalchemy.Integer) - item5 = sqlalchemy.Column(sqlalchemy.Integer) - item6 = sqlalchemy.Column(sqlalchemy.Integer) - killingSprees = sqlalchemy.Column(sqlalchemy.Integer) - kills = sqlalchemy.Column(sqlalchemy.Integer) - largestCriticalStrike = sqlalchemy.Column(sqlalchemy.Integer) - largestKillingSpree = sqlalchemy.Column(sqlalchemy.Integer) - largestMultiKill = sqlalchemy.Column(sqlalchemy.Integer) - magicDamageDealt = sqlalchemy.Column(sqlalchemy.Integer) - magicDamageDealtToChampions = sqlalchemy.Column(sqlalchemy.Integer) - magicDamageTaken = sqlalchemy.Column(sqlalchemy.Integer) - minionsKilled = sqlalchemy.Column(sqlalchemy.Integer) - neutralMinionsKilled = sqlalchemy.Column(sqlalchemy.Integer) - neutralMinionsKilledEnemyJungle = sqlalchemy.Column(sqlalchemy.Integer) - neutralMinionsKilledTeamJungle = sqlalchemy.Column(sqlalchemy.Integer) - nodeCapture = sqlalchemy.Column(sqlalchemy.Integer) - nodeCaptureAssist = sqlalchemy.Column(sqlalchemy.Integer) - nodeNeutralize = sqlalchemy.Column(sqlalchemy.Integer) - nodeNeutralizeAssist = sqlalchemy.Column(sqlalchemy.Integer) - objectivePlayerScore = sqlalchemy.Column(sqlalchemy.Integer) - pentaKills = sqlalchemy.Column(sqlalchemy.Integer) - physicalDamageDealt = sqlalchemy.Column(sqlalchemy.Integer) - physicalDamageDealtToChampions = sqlalchemy.Column(sqlalchemy.Integer) - physicalDamageTaken = sqlalchemy.Column(sqlalchemy.Integer) - quadraKills = sqlalchemy.Column(sqlalchemy.Integer) - sightWardsBoughtInGame = sqlalchemy.Column(sqlalchemy.Integer) - teamObjective = sqlalchemy.Column(sqlalchemy.Integer) - totalDamageDealt = sqlalchemy.Column(sqlalchemy.Integer) - totalDamageDealtToChampions = sqlalchemy.Column(sqlalchemy.Integer) - totalDamageTaken = sqlalchemy.Column(sqlalchemy.Integer) - totalHeal = sqlalchemy.Column(sqlalchemy.Integer) - totalPlayerScore = sqlalchemy.Column(sqlalchemy.Integer) - totalScoreRank = sqlalchemy.Column(sqlalchemy.Integer) - totalTimeCrowdControlDealt = sqlalchemy.Column(sqlalchemy.Integer) - totalUnitsHealed = sqlalchemy.Column(sqlalchemy.Integer) - towerKills = sqlalchemy.Column(sqlalchemy.Integer) - tripleKills = sqlalchemy.Column(sqlalchemy.Integer) - trueDamageDealt = sqlalchemy.Column(sqlalchemy.Integer) - trueDamageDealtToChampions = sqlalchemy.Column(sqlalchemy.Integer) - trueDamageTaken = sqlalchemy.Column(sqlalchemy.Integer) - unrealKills = sqlalchemy.Column(sqlalchemy.Integer) - visionWardsBoughtInGame = sqlalchemy.Column(sqlalchemy.Integer) - wardsKilled = sqlalchemy.Column(sqlalchemy.Integer) - wardsPlaced = sqlalchemy.Column(sqlalchemy.Integer) - winner = sqlalchemy.Column(sqlalchemy.Boolean) - _id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - _participant_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("HistoryParticipant._id", ondelete="CASCADE")) - -def _sa_bind_participant_timeline(): - global ParticipantTimeline - @cassiopeia.type.core.common.inheritdocs - class ParticipantTimeline(ParticipantTimeline, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryParticipantTimeline" - ancientGolemAssistsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='ancientGolemAssistsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - ancientGolemKillsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='ancientGolemKillsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - assistedLaneDeathsPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='assistedLaneDeathsPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - assistedLaneKillsPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='assistedLaneKillsPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - baronAssistsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='baronAssistsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - baronKillsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='baronKillsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - creepsPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='creepsPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - csDiffPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='csDiffPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - damageTakenDiffPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='damageTakenDiffPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - damageTakenPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='damageTakenPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - dragonAssistsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='dragonAssistsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - dragonKillsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='dragonKillsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - elderLizardAssistsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='elderLizardAssistsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - elderLizardKillsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='elderLizardKillsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - goldPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='goldPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - inhibitorAssistsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='inhibitorAssistsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - inhibitorKillsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='inhibitorKillsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - lane = sqlalchemy.Column(sqlalchemy.String(30)) - role = sqlalchemy.Column(sqlalchemy.String(30)) - towerAssistsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='towerAssistsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - towerKillsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='towerKillsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - towerKillsPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='towerKillsPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - vilemawAssistsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='vilemawAssistsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - vilemawKillsPerMinCounts = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='vilemawKillsPerMinCounts')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - wardsPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='wardsPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - xpDiffPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='xpDiffPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - xpPerMinDeltas = sqlalchemy.orm.relationship("cassiopeia.type.dto.matchhistory.ParticipantTimelineData", primaryjoin="and_(cassiopeia.type.dto.matchhistory.ParticipantTimeline._id==cassiopeia.type.dto.matchhistory.ParticipantTimelineData._timeline_id, cassiopeia.type.dto.matchhistory.ParticipantTimelineData._type=='xpPerMinDeltas')", uselist=False, cascade="all, delete-orphan", passive_deletes=True) - _id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - _participant_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("HistoryParticipant._id", ondelete="CASCADE")) - -def _sa_bind_rune(): - global Rune - @cassiopeia.type.core.common.inheritdocs - class Rune(Rune, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryRune" - rank = sqlalchemy.Column(sqlalchemy.Integer) - runeId = sqlalchemy.Column(sqlalchemy.Integer) - _id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - _participant_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("HistoryParticipant._id", ondelete="CASCADE")) - -def _sa_bind_player(): - global Player - @cassiopeia.type.core.common.inheritdocs - class Player(Player, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryPlayer" - matchHistoryUri = sqlalchemy.Column(sqlalchemy.String(50)) - profileIcon = sqlalchemy.Column(sqlalchemy.Integer) - summonerId = sqlalchemy.Column(sqlalchemy.Integer) - summonerName = sqlalchemy.Column(sqlalchemy.String(30)) - _id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - _participant_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("HistoryParticipantIdentity._id", ondelete="CASCADE")) - -def _sa_bind_participant_timeline_data(): - global ParticipantTimelineData - @cassiopeia.type.core.common.inheritdocs - class ParticipantTimelineData(ParticipantTimelineData, cassiopeia.type.dto.common.BaseDB): - __tablename__ = "HistoryParticipantTimelineData" - tenToTwenty = sqlalchemy.Column(sqlalchemy.Float) - thirtyToEnd = sqlalchemy.Column(sqlalchemy.Float) - twentyToThirty = sqlalchemy.Column(sqlalchemy.Float) - zeroToTen = sqlalchemy.Column(sqlalchemy.Float) - _type = sqlalchemy.Column(sqlalchemy.String(50)) - _id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) - _timeline_id = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("HistoryParticipantTimeline._id", ondelete="CASCADE")) - -def _sa_bind_all(): - _sa_bind_match_summary() - _sa_bind_participant() - _sa_bind_participant_identity() - _sa_bind_mastery() - _sa_bind_participant_stats() - _sa_bind_participant_timeline() - _sa_bind_rune() - _sa_bind_player() - _sa_bind_participant_timeline_data() \ No newline at end of file diff --git a/setup.py b/setup.py index 58982703..ff999fbe 100755 --- a/setup.py +++ b/setup.py @@ -4,12 +4,12 @@ setup( name="cassiopeia", - version="0.0.6", + version="0.0.7", author="Rob Rua", author_email="robrua@alumni.cmu.edu", url="https://github.com/robrua/cassiopeia", description="Riot Games Developer API Wrapper (3rd Party)", - keywords=["LoL", "League of Legends", "Riot Game", "API", "REST"], + keywords=["LoL", "League of Legends", "Riot Games", "API", "REST"], classifiers=[ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3",