meraki-analytics / cassiopeia

An all-inclusive Python framework for the Riot Games League of Legends API. Cass focuses on making the data easy and fun to work with, while providing all the tools necessary to create a website or do data analysis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get positions more than once every minute?

JasonMendoza2008 opened this issue · comments

I'm printing a player position every 5 seconds and I realised it only changes every 60 seconds. Is there a reason why? Doesn't Riot store more information? Or is it on the side of Cassiopeia? Or is it me who's doing something wrong? I know Cassiopeia's example says "some data is only available once every minute", is there no way to bypass that?

Here is a minimal reproducible example:

from cassiopeia import Summoner
import datetime


def print_newest_match(name: str, region: str) -> None:
    summoner = Summoner(name=name, region=region)

    match_history = summoner.match_history
    match = match_history[0]
    p = match.participants[summoner]
    for seconds in range(0, 6000, 5):
        p_state = p.cumulative_timeline[datetime.timedelta(minutes=0, seconds=seconds)]
        print("Position:", p_state.position)