Module genshin.models.honkai.chronicle.stats

Honkai stats models.

Classes

class FullHonkaiUserStats (**data: Any)
Expand source code
class FullHonkaiUserStats(HonkaiUserStats):
    """Represents a user's full stats, including characters, gear, and gamemode data"""

    battlesuits: typing.Sequence[honkai_battlesuits.FullBattlesuit]
    abyss: typing.Sequence[typing.Union[modes.SuperstringAbyss, modes.OldAbyss]]
    memorial_arena: typing.Sequence[modes.MemorialArena]
    elysian_realm: typing.Sequence[modes.ElysianRealm]

    @property
    def abyss_superstring(self) -> typing.Sequence[modes.SuperstringAbyss]:
        """Filter `self.abyss` to only return instances of Superstring Abyss."""
        return [entry for entry in self.abyss if isinstance(entry, modes.SuperstringAbyss)]

Represents a user's full stats, including characters, gear, and gamemode data

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var abyss : Sequence[SuperstringAbyss | OldAbyss]
var battlesuits : Sequence[FullBattlesuit]
var elysian_realm : Sequence[ElysianRealm]
var memorial_arena : Sequence[MemorialArena]
var model_config : pydantic.config.ConfigDict

Instance variables

prop abyss_superstring : Sequence[SuperstringAbyss]
Expand source code
@property
def abyss_superstring(self) -> typing.Sequence[modes.SuperstringAbyss]:
    """Filter `self.abyss` to only return instances of Superstring Abyss."""
    return [entry for entry in self.abyss if isinstance(entry, modes.SuperstringAbyss)]

Filter self.abyss to only return instances of Superstring Abyss.

class HonkaiStats (**data: Any)
Expand source code
class HonkaiStats(APIModel):
    """Represents a user's stat page"""

    active_days: int = Aliased("active_day_number")
    achievements: int = Aliased("achievement_number")

    battlesuits: int = Aliased("armor_number")
    battlesuits_SSS: int = Aliased("sss_armor_number")
    stigmata: int = Aliased("stigmata_number")
    stigmata_5star: int = Aliased("five_star_stigmata_number")
    weapons: int = Aliased("weapon_number")
    weapons_5star: int = Aliased("five_star_weapon_number")
    outfits: int = Aliased("suit_number")

    abyss: typing.Union[SuperstringAbyssStats, OldAbyssStats] = Aliased()
    memorial_arena: MemorialArenaStats = Aliased()
    elysian_realm: ElysianRealmStats = Aliased()

    @pydantic.model_validator(mode="before")
    def __pack_gamemode_stats(cls, values: dict[str, typing.Any]) -> dict[str, typing.Any]:
        if "new_abyss" in values:
            values["abyss"] = SuperstringAbyssStats(**values["new_abyss"], **values)
        elif "old_abyss" in values:
            values["abyss"] = OldAbyssStats(**values["old_abyss"], **values)

        if "memorial_arena" not in values:
            values["memorial_arena"] = MemorialArenaStats(**values)

        if "elysian_realm" not in values:
            values["elysian_realm"] = ElysianRealmStats(**values)

        return values

Represents a user's stat page

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var abyss : genshin.models.honkai.chronicle.stats.SuperstringAbyssStats | genshin.models.honkai.chronicle.stats.OldAbyssStats
var achievements : int
var active_days : int
var battlesuits : int
var battlesuits_SSS : int
var elysian_realm : genshin.models.honkai.chronicle.stats.ElysianRealmStats
var memorial_arena : genshin.models.honkai.chronicle.stats.MemorialArenaStats
var model_config : pydantic.config.ConfigDict
var outfits : int
var stigmata : int
var stigmata_5star : int
var weapons : int
var weapons_5star : int
class HonkaiUserStats (**data: Any)
Expand source code
class HonkaiUserStats(APIModel):
    """Represents basic user stats, showing only generic user data and stats."""

    info: hoyolab.UserInfo = Aliased("role")
    stats: HonkaiStats

Represents basic user stats, showing only generic user data and stats.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var infoUserInfo
var model_config : pydantic.config.ConfigDict
var statsHonkaiStats