cache package#

Submodules#

cache.cache_helpers module#

class Statistic(*, set_default: bool = False)[source]#

Bases: object

class RunStats[source]#

Bases: object

property is_loaded: bool#
property date_range_string: str#
add_win(char: str, run_date: <module 'datetime' from '/opt/hostedtoolcache/Python/3.11.13/x64/lib/python3.11/datetime.py'>)[source]#
add_loss(char: str, run_date: <module 'datetime' from '/opt/hostedtoolcache/Python/3.11.13/x64/lib/python3.11/datetime.py'>)[source]#
check_pb(run: RunParser)[source]#
clear()[source]#
class RunStatsByDate[source]#

Bases: RunStats

property date_range_string: str#
class RunLinkedListNode[source]#

Bases: object

get_run(*, is_prev: bool, is_character_specific: bool) RunParser[source]#
class MasteryStats[source]#

Bases: object

class StreakCache(since: datetime)[source]#

Bases: object

A streak superclass that contains StreakContainer objects.

clear()[source]#
prepend(containers)[source]#
property latest#
class StreakContainer(winning_streak: bool, runs)[source]#

Bases: object

Collection of runs that form a winning or losing streak.

The winning_streak attribute denotes if the streak contains wins or not. The notion of losing streaks are used on the streak page to show how many runs were between the streaks.

The ongoing attribute denotes if the streak is still going. If it’s True, this is shown on the streak date in the UI.

The runs attribute is the list of runs in the streak. If the streak is over, the losing run that broke it should be in there as well so it can be shown in the UI as the one that broke it.

append(runs)[source]#
get_run(x)[source]#
property display_runs#

The runs, but with possible added context runs: - The losing run included if this is a winning streak that is over. - The current run if we are live and the stream is ongoing.

property start#
property end#
property runs_url#
property character#
property verb#
property length#
property target#

The amount of blobs to show for this group.

If less than 20, show 20. After 20, show ten more for every ten passed.

property streak#

Counts the amount of runs that were the actual streak.

Without this, the streak would show one too many once it’s over since we care to show the losing run inside the streak collection.

cache.mastered module#

update_mastery_stats()[source]#
get_mastered()[source]#
get_current_masteries(save: Savefile)[source]#

cache.run_stats module#

update_all_run_stats()[source]#
get_all_run_stats()[source]#
get_run_stats_by_date(start_date: datetime | None = None, end_date: datetime | None = None) RunStatsByDate[source]#
get_run_stats_by_date_string(date_string: str) RunStatsByDate[source]#

cache.streaks module#

update_streak_collections()[source]#

Module contents#