Models
hsr
Modules:
-
build– -
character– -
icon– -
player– -
response–
Classes:
-
Build–Represents a HSR build.
-
Character–Represents a character in HSR.
-
CharacterIcon–Represents a HSR character icon.
-
LightCone–Represents a light cone (weapon.)
-
LightConeIcon–Represents a HSR light cone icon.
-
Player–Represents a HSR player.
-
PlayerStats–Represents the statistics of a HSR player.
-
Relic–Represents a relic in HSR.
-
RelicSubAffix–Represents a relic's sub-stat information.
-
ShowcaseResponse–Represents a HSR showcase response.
-
Stat–Represents a HSR stat.
-
Trace–Represents a character's trace (skill).
Build
pydantic-model
Character
pydantic-model
Represents a character in HSR.
Attributes:
-
level(int) –The character's level.
-
ascension(Literal[0, 1, 2, 3, 4, 5, 6]) –The character's ascension level.
-
id(int) –The character's ID.
-
traces(list[Trace]) –List of the character's traces (skills).
-
light_cone(LightCone | None) –The character's light cone (weapon).
-
relics(list[Relic]) –List of the character's relics.
-
eidolons(list[Eidolon]) –List of the character's eidolons.
-
eidolons_unlocked(int) –The number of unlocked eidolons.
-
is_assist(bool) –Whether the character is an assist character.
-
icon(CharacterIcon) –The character's icon.
-
name(str) –The character's name.
-
rarity(Literal[4, 5]) –The character's rarity.
-
element(Element) –The character's element (type.)
-
path(Path) –The character's path.
-
stats(dict[StatType, Stat]) –The character's stats.
-
enhanced(bool) –Whether the character's traces are enhanced.
Config:
arbitrary_types_allowed:True
Fields:
-
level(int) -
ascension(Literal[0, 1, 2, 3, 4, 5, 6]) -
id(int) -
traces(list[Trace]) -
light_cone(LightCone | None) -
relics(list[Relic]) -
eidolons(list[Eidolon]) -
eidolons_unlocked(int) -
is_assist(bool) -
icon(CharacterIcon) -
name(str) -
rarity(Literal[4, 5]) -
element(Element) -
path(Path) -
stats(dict[StatType, Stat]) -
enhanced(bool)
Validators:
-
__no_light_cone→light_cone
model_config
class-attribute
instance-attribute
model_config = ConfigDict(arbitrary_types_allowed=True)
CharacterIcon
pydantic-model
Represents a HSR character icon.
Attributes:
-
character_id(int) –The character's ID.
Fields:
card
property
card: str
Character icon in card shape.
Provided by Project Yatta. e.g. https://api.yatta.top/hsr/assets/UI//avatar/medium/1001.png
gacha
property
gacha: str
Character gacha splash art.
e.g. https://enka.network/ui/hsr/SpriteOutput/AvatarDrawCard/1001.png
round
property
round: str
Character icon in round shape.
e.g. https://enka.network/ui/hsr/SpriteOutput/AvatarRoundIcon/1001.png
LightCone
pydantic-model
Represents a light cone (weapon.)
Attributes:
-
id(int) –The light cone's ID.
-
level(int) –The light cone's level.
-
ascension(Literal[0, 1, 2, 3, 4, 5, 6]) –The light cone's ascension level.
-
superimpose(Literal[1, 2, 3, 4, 5]) –The light cone's superimpose level.
-
name(str) –The name of the light cone.
-
stats(list[Stat]) –The stats of the light cone.
-
rarity(Literal[3, 4, 5]) –The rarity of the light cone.
-
icon(LightConeIcon) –The icon of the light cone.
-
path(Path) –The light cone's path.
Config:
arbitrary_types_allowed:True
Fields:
-
id(int) -
level(int) -
ascension(Literal[0, 1, 2, 3, 4, 5, 6]) -
superimpose(Literal[1, 2, 3, 4, 5]) -
name(str) -
stats(list[Stat]) -
icon(LightConeIcon) -
rarity(Literal[3, 4, 5]) -
path(Path)
Validators:
-
_stringify_name→name -
_flatten_flat
model_config
class-attribute
instance-attribute
model_config = ConfigDict(arbitrary_types_allowed=True)
LightConeIcon
pydantic-model
Represents a HSR light cone icon.
Attributes:
-
light_cone_id(int) –The light cone's ID.
Fields:
Player
pydantic-model
Represents a HSR player.
Attributes:
-
nickname(str) –The player's nickname.
-
signature(str) –The player's signature.
-
uid(int) –The player's UID.
-
level(int) –The player's level.
-
equilibrium_level(int) –The player's equilibrium level.
-
friend_count(int) –The number of friends the player has.
-
stats(PlayerStats) –The player's statistics.
Fields:
-
nickname(str) -
signature(str) -
uid(int) -
level(int) -
equilibrium_level(int) -
friend_count(int) -
stats(PlayerStats) -
icon(str)
Validators:
-
_stringify_icon→icon
PlayerStats
pydantic-model
Represents the statistics of a HSR player.
Attributes:
-
achievement_count(int) –The number of achievements the player has.
-
light_cone_count(int) –The number of light cones the player has.
-
character_count(int) –The number of characters the player has.
-
max_simulated_universe_world(int | None) –The maximum world completed in the simulated universe.
-
book_count(int | None) –The number of books the player has, added in game version 2.2
-
relic_count(int | None) –The number of relics the player has, added in game version 2.2
-
music_count(int | None) –The number of music tracks the player has, added in game version 2.2
Fields:
-
achievement_count(int) -
light_cone_count(int) -
character_count(int) -
max_simulated_universe_world(int | None) -
book_count(int | None) -
relic_count(int | None) -
music_count(int | None)
Relic
pydantic-model
Represents a relic in HSR.
Attributes:
-
id(int) –The relic's ID.
-
level(int) –The relic's level.
-
type(RelicType) –The relic's type.
-
main_affix_id(int) –The ID of the main affix.
-
set_name(str) –The name of the relic set.
-
set_id(int) –The ID of the relic set.
-
stats(list[Stat]) –The stats of the relic.
-
sub_affix_list(list[RelicSubAffix]) –List of sub-stat information for the relic.
-
icon(str) –The icon of the relic.
-
rarity(Literal[3, 4, 5]) –The rarity of the relic.
Fields:
-
id(int) -
level(int) -
type(RelicType) -
main_affix_id(int) -
stats(list[Stat]) -
sub_affix_list(list[RelicSubAffix]) -
icon(str) -
rarity(Literal[3, 4, 5]) -
set_id(int) -
set_name(str)
Validators:
-
_stringify_set_name→set_name -
_extract_props
RelicSubAffix
pydantic-model
ShowcaseResponse
pydantic-model
Represents a HSR showcase response.
Attributes:
-
characters(list[Character]) –The characters in the showcase.
-
player(Player) –The player.
-
ttl(int) –The time to live of the response.
-
uid(str) –The UID of the showcase.
-
owner(Owner | None) –The owner of the showcase's account, if any.
Fields:
Validators:
-
_flatten_data
Stat
pydantic-model
Trace
pydantic-model
Represents a character's trace (skill).
Attributes:
-
id(int) –The trace's ID.
-
level(int) –The trace's level.
-
boosted(bool) –Whether the trace's level is boosted by an activated eidolon's effect.
-
icon(str) –The trace's icon.
-
max_level(int) –The trace's maximum level.
-
anchor(str) –The trace's anchor.
-
type(TraceType) –The trace's type.
Fields:
boosted
pydantic-field
boosted: bool = False
Whether the level of this trace is boosted by an activated eidolon's effect.