Skip to content

API Reference

hsr

Modules:

  • character
  • endgame
  • enemy_groups
  • light_cone
  • monster
  • new
  • relic

Classes:

ApocBuff pydantic-model

Represents the fixed global buff in Apocalyptic Shadow.

Attributes:

  • name (str) –

    Name of the buff.

  • desc (str) –

    Description of the effect.

Fields:

Validators:

  • __format_fields
  • __handle_missing_fieldsname, desc

desc pydantic-field

desc: str = ''

name pydantic-field

name: str = ''

ApocDetail pydantic-model

Apocalyptic Shadow event details.

Attributes:

Fields:

Validators:

Character pydantic-model

Represent an HSR character.

Attributes:

Fields:

Validators:

  • __format_fields
  • __convert_iconicon
  • __convert_rarityrarity
  • __convert_descriptiondescription
  • __transform_names

description pydantic-field

description: str

element pydantic-field

element: HSRElement

icon pydantic-field

icon: str

id pydantic-field

id: int

name pydantic-field

name: str = ''

names pydantic-field

names: dict[Literal['en', 'zh', 'ko', 'ja'], str]

path pydantic-field

path: HSRPath

rarity pydantic-field

rarity: Literal[4, 5]

CharacterDetail pydantic-model

Represent an HSR character detail.

Attributes:

Fields:

Validators:

  • __format_fields
  • __convert_rarityrarity
  • __convert_descriptiondescription
  • __remove_invalid_skillsskills
  • __extract_id

ascension_stats pydantic-field

ascension_stats: dict[str, dict[str, Any]]

description pydantic-field

description: str

eidolons pydantic-field

eidolons: dict[str, Eidolon]

gacha_art property

gacha_art: str

Get the character's gacha art URL.

icon property

icon: str

Get the character's icon URL.

id pydantic-field

id: int

name pydantic-field

name: str

rarity pydantic-field

rarity: Literal[4, 5]

skills pydantic-field

skills: dict[str, Skill]

ChildMonster pydantic-model

Represent the specific details of a monster type.

Attributes:

Fields:

Validators:

  • __format_fields

attack_modify_ratio pydantic-field

attack_modify_ratio: float = 1

damage_type_resistances pydantic-field

damage_type_resistances: list[DamageTypeResistance]

defence_modify_ratio pydantic-field

defence_modify_ratio: float = 1

hp_modify_ratio pydantic-field

hp_modify_ratio: float = 1

id pydantic-field

id: int

skills pydantic-field

spd_modify_ratio pydantic-field

spd_modify_ratio: float = 1

spd_modify_value pydantic-field

spd_modify_value: float | None = None

stance_modify_value pydantic-field

stance_modify_value: float = 1

stance_weak_list pydantic-field

stance_weak_list: list[HSRElement]

DamageTypeResistance pydantic-model

Represent the damage resistance of an enemy in HSR.

Attributes:

Fields:

Validators:

  • __format_fields

element pydantic-field

element: HSRElement

value pydantic-field

value: float

Eidolon pydantic-model

Represent a character's eidolon.

Attributes:

Fields:

Validators:

  • __format_fields

description pydantic-field

description: str

id pydantic-field

id: int

image property

image: str

Get the eidolon's image URL.

name pydantic-field

name: str

parameters pydantic-field

parameters: list[float]

EliteGroup pydantic-model

Represent an EliteGroup in HSR.

All enemies in HSR follow the following formula for ATK, DEF, HP, and SPD: Base x BaseModifyRatio x EliteGroup Ratio x HardLevelGroup(Level) Ratio x (1 + HPMultiplier)

Attributes:

Fields:

Validators:

attack_ratio pydantic-field

attack_ratio: float = 0

defence_ratio pydantic-field

defence_ratio: float = 0

hp_ratio pydantic-field

hp_ratio: float = 0

id pydantic-field

id: int

spd_ratio pydantic-field

spd_ratio: float = 0

stance_ratio pydantic-field

stance_ratio: float = 0

handle_missing_fields pydantic-validator

handle_missing_fields(value: Any) -> float

EndgameBaseModel pydantic-model

Abstract base class for all HSR endgame modes.

Attributes:

Fields:

Validators:

begin_time pydantic-field

begin_time: str = ''

end_time pydantic-field

end_time: str = ''

id pydantic-field

id: int

name pydantic-field

name: str = ''

stages pydantic-field

stages: list[EndgameStage]

EndgameBuffOptions pydantic-model

Represents a selectable buff modifier in endgame.

Attributes:

  • name (str) –

    Name of the buff.

  • desc (str) –

    Description of the buff effect.

  • params (list[float]) –

    List of parameters applied by the buff.

Fields:

Validators:

  • __format_fields

desc pydantic-field

desc: str

name pydantic-field

name: str

params pydantic-field

params: list[float]

EndgameHalf pydantic-model

Represents one half of an endgame stage (first or second).

Attributes:

  • hlg_id (int) –

    ID of the HardLevelGroup used to determine difficulty scaling.

  • hlg_level (int) –

    Level of the HardLevelGroup (affects enemy stats).

  • eg_id (int) –

    ID of the EliteGroup (affects enemy traits).

  • waves (list[EndgameWave]) –

    List of enemy waves in this half.

Fields:

Validators:

  • __format_fields

eg_id pydantic-field

eg_id: int = 1

hlg_id pydantic-field

hlg_id: int = 1

hlg_level pydantic-field

hlg_level: int = 1

waves pydantic-field

waves: list[EndgameWave]

EndgameStage pydantic-model

Represents a stage in an endgame mode.

Attributes:

Fields:

Validators:

  • __format_fields
  • __handle_missing_namename
  • __unwrap_event_lists

first_half pydantic-field

first_half: EndgameHalf

first_half_weaknesses pydantic-field

first_half_weaknesses: list[HSRElement]

id pydantic-field

id: int

name pydantic-field

name: str

second_half pydantic-field

second_half: EndgameHalf | None

second_half_weaknesses pydantic-field

second_half_weaknesses: list[HSRElement]

EndgameSummary pydantic-model

Summary metadata for an HSR endgame event.

Attributes:

  • id (int) –

    ID of the endgame.

  • type (HSREndgameType) –

    The type/category of the endgame.

  • names (dict[Literal['en', 'zh', 'ko', 'ja'], str]) –

    Dictionary containing localized names in English (en), Chinese (cn), Korean (kr), and Japanese (jp).

  • name (str) –

    The selected name to display (populated during post-processing).

  • begin (str) –

    Event start timestamp.

  • end (str) –

    Event end timestamp.

Fields:

Validators:

  • __format_fields
  • __transform_names

begin pydantic-field

begin: str = ''

end pydantic-field

end: str = ''

id pydantic-field

id: int

name pydantic-field

name: str = ''

names pydantic-field

names: dict[Literal['en', 'zh', 'ko', 'ja'], str]

type pydantic-field

EndgameWave pydantic-model

Represents a wave of enemies in an endgame half.

Attributes:

Fields:

Validators:

  • __format_fields
  • __handle_missing_hphp_multiplier
  • __extract_monster_ids

enemies pydantic-field

enemies: list[int]

hp_multiplier pydantic-field

hp_multiplier: float = 0

FullApocDetail pydantic-model

Apocalyptic Shadow event details with processed enemies.

Attributes:

Fields:

Validators:

FullEndgameBaseModel pydantic-model

Endgame base model with processed enemies.

Attributes:

Fields:

Validators:

stages pydantic-field

FullEndgameHalf pydantic-model

Represents one half of an endgame stage (first or second) with processed enemies.

Attributes:

  • hlg_id (int) –

    ID of the HardLevelGroup used to determine difficulty scaling.

  • hlg_level (int) –

    Level of the HardLevelGroup (affects enemy stats).

  • eg_id (int) –

    ID of the EliteGroup (affects enemy traits).

  • waves (list[FullEndgameWave]) –

    List of enemy waves in this half with processed enemies.

Fields:

Validators:

  • __format_fields

waves pydantic-field

FullEndgameStage pydantic-model

Represents a stage in an endgame mode with processed enemies.

Attributes:

Fields:

Validators:

  • __format_fields
  • __handle_missing_namename
  • __unwrap_event_lists

first_half pydantic-field

first_half: FullEndgameHalf

second_half pydantic-field

second_half: FullEndgameHalf | None

FullEndgameWave pydantic-model

Represents a wave of processed enemies in an endgame half.

Attributes:

Fields:

Validators:

  • __format_fields
  • __handle_missing_hphp_multiplier
  • __extract_monster_ids

enemies pydantic-field

enemies: list[ProcessedEnemy]

FullMOCDetail pydantic-model

Memory of Chaos event details with processed enemies.

Attributes:

  • memory_turbulence (str) –

    Global modifier for the current MoC rotation.

Fields:

Validators:

FullPFDetail pydantic-model

Pure Fiction event details with processed enemies.

Attributes:

Fields:

Validators:

HSREnemySkill pydantic-model

Represents an enemy skill's information.

Attributes:

  • id (int) –

    The id of the skill.

  • name (str) –

    The name of the skill

  • desc (str) –

    The description of what the skill does

  • damage_type (HSRElement | None) –

    The type of damage the skill does (out of the HSRElements or None)

Fields:

Validators:

damage_type pydantic-field

damage_type: HSRElement | None = None

desc pydantic-field

desc: str = ''

id pydantic-field

id: int

name pydantic-field

name: str = ''

default_empty_string pydantic-validator

default_empty_string(value: str | None) -> str

empty_string_to_none pydantic-validator

empty_string_to_none(v: str | None) -> str | None

HardLevelGroup pydantic-model

Represent a HardLevelGroup in HSR.

All enemies in HSR follow the following formula for ATK, DEF, HP, and SPD: Base x BaseModifyRatio x EliteGroup Ratio x HardLevelGroup(Level) Ratio x (1 + HPMultiplier)

Attributes:

Fields:

Validators:

attack_ratio pydantic-field

attack_ratio: float = 0

defence_ratio pydantic-field

defence_ratio: float = 0

hp_ratio pydantic-field

hp_ratio: float = 0

id pydantic-field

id: int

level pydantic-field

level: int

spd_ratio pydantic-field

spd_ratio: float = 0

stance_ratio pydantic-field

stance_ratio: float = 0

status_resistance pydantic-field

status_resistance: float = 0

handle_missing_fields pydantic-validator

handle_missing_fields(value: Any) -> float

LightCone pydantic-model

Represent an HSR light cone.

Attributes:

  • id (int) –

    The ID of the light cone.

  • rarity (Literal[3, 4, 5]) –

    The rarity of the light cone.

  • description (str) –

    The description of the light cone.

  • path (HSRPath) –

    The path of the light cone.

  • names (dict[Literal['en', 'zh', 'ko', 'ja'], str]) –

    A dictionary of names in different languages.

  • name (str) –

    The name of the light cone.

Fields:

Validators:

  • __format_fields
  • __handle_null_valuedescription
  • __convert_iconicon
  • __convert_rarityrarity
  • __transform_names

description pydantic-field

description: str

icon property

icon: str

Get the light cone's icon URL.

id pydantic-field

id: int

name pydantic-field

name: str = ''

names pydantic-field

names: dict[Literal['en', 'zh', 'ko', 'ja'], str]

path pydantic-field

path: HSRPath

rarity pydantic-field

rarity: Literal[3, 4, 5]

LightConeDetail pydantic-model

Represent an HSR light cone detail.

Attributes:

Fields:

Validators:

  • __format_fields
  • __convert_rarityrarity
  • __extract_id

ascension_stats pydantic-field

ascension_stats: list[dict[str, Any]]

description pydantic-field

description: str | None = None

icon property

icon: str

Get the light cone's icon URL.

id pydantic-field

id: int

image property

image: str

Get the light cone's image URL.

name pydantic-field

name: str

path pydantic-field

path: HSRPath

rarity pydantic-field

rarity: Literal[3, 4, 5]

superimpose_info pydantic-field

superimpose_info: SuperimposeInfo

MOCDetail pydantic-model

Memory of Chaos event details.

Attributes:

  • memory_turbulence (str) –

    Global modifier for the current MoC rotation.

Fields:

Validators:

Monster pydantic-model

Represent an enemy monster in HSR.

Attributes:

  • id (int) –

    The ID of the monster.

  • icon (str) –

    The icon URL of the monster.

  • children (list[int]) –

    A list of child monster IDs associated with this monster.

  • weaknesses (list[HSRElement]) –

    List of elements that this monster is weak to (used for breaking toughness).

  • names (dict[Literal['en', 'zh', 'ko', 'ja'], str]) –

    A dictionary of names in different languages.

  • description (str) –

    The English description of the monster.

  • name (str) –

    The English name of the monster.

Fields:

Validators:

children pydantic-field

children: list[int]

description pydantic-field

description: str = ''

icon pydantic-field

icon: str

id pydantic-field

id: int

name pydantic-field

name: str = ''

names pydantic-field

names: dict[Literal['en', 'zh', 'ko', 'ja'], str]

weaknesses pydantic-field

weaknesses: list[HSRElement]

default_empty_string_listing pydantic-validator

default_empty_string_listing(value: str | None) -> str

MonsterDetail pydantic-model

Represent an enemy monster with details in HSR.

Attributes:

Fields:

Validators:

attack_base pydantic-field

attack_base: float = 0

defence_base pydantic-field

defence_base: float = 0

description pydantic-field

description: str = ''

hp_base pydantic-field

hp_base: float = 0

icon property

icon: str

Get the monster's icon URL.

id pydantic-field

id: int

monster_types pydantic-field

monster_types: list[ChildMonster]

name pydantic-field

name: str = ''

rank pydantic-field

rank: str

spd_base pydantic-field

spd_base: float = 0

stance_base pydantic-field

stance_base: float = 0

status_resistance_base pydantic-field

status_resistance_base: float = 0

default_empty_string pydantic-validator

default_empty_string(value: str | None) -> str

default_zero_if_none pydantic-validator

default_zero_if_none(
    value: int | float | None,
) -> int | float

New pydantic-model

Represent new Honkai Star Rail data.

Attributes:

Fields:

Validators:

  • __format_fields

character_ids pydantic-field

character_ids: list[int]

item_ids pydantic-field

item_ids: list[int]

light_cone_ids pydantic-field

light_cone_ids: list[int]

monster_ids pydantic-field

monster_ids: list[int]

relic_set_ids pydantic-field

relic_set_ids: list[int]

version pydantic-field

version: str

PFDetail pydantic-model

Pure Fiction event details.

Attributes:

Fields:

Validators:

ProcessedEnemy pydantic-model

Represents a processed enemy instance in a HSR endgame stage.

Attributes:

Fields:

Validators:

  • __format_fields

base_hp pydantic-field

base_hp: int

effect_res pydantic-field

effect_res: float | None

id pydantic-field

id: int

level pydantic-field

level: int

name pydantic-field

name: str = ''

speed pydantic-field

speed: int | None

toughness pydantic-field

toughness: int | None

weaknesses pydantic-field

weaknesses: list[HSRElement]

Relic pydantic-model

Represent an HSR relic.

Attributes:

  • id (int) –

    The ID of the relic.

  • name (str) –

    The name of the relic.

  • description (str | None) –

    The description of the relic.

  • story (str | None) –

    The story of the relic.

Fields:

Validators:

  • __format_fields

description pydantic-field

description: str | None = None

icon property

icon: str

Get the relic's icon URL.

id pydantic-field

id: int = 0

name pydantic-field

name: str

story pydantic-field

story: str | None = None

RelicSet pydantic-model

Represent an HSR relic set.

Attributes:

Fields:

Validators:

  • __format_fields
  • __convert_iconicon
  • __assign_set_effectset_effect
  • __assign_names

icon pydantic-field

icon: str

id pydantic-field

id: int

name pydantic-field

name: str = ''

names pydantic-field

names: dict[Literal['en', 'zh', 'ko', 'ja'], str]

set_effect pydantic-field

set_effect: RelicSetEffects

RelicSetDetail pydantic-model

Represent an HSR relic set detail.

Attributes:

Fields:

Validators:

  • __format_fields
  • __convert_iconicon
  • __assign_set_effectsset_effects
  • __convert_partsparts

icon pydantic-field

icon: str

name pydantic-field

name: str

parts pydantic-field

parts: dict[str, Relic]

set_effects pydantic-field

set_effects: SetDetailSetEffects

RelicSetEffect pydantic-model

Represent a relic set effect.

Attributes:

Fields:

Validators:

  • __format_fields
  • __assign_descriptions

description pydantic-field

description: str = ''

descriptions pydantic-field

descriptions: dict[Literal['en', 'zh', 'ko', 'ja'], str]

parameters pydantic-field

parameters: list[float]

RelicSetEffects pydantic-model

Represent a relic set's set effects.

Attributes:

Fields:

Validators:

  • __format_fields

four_piece pydantic-field

four_piece: RelicSetEffect | None = None

two_piece pydantic-field

two_piece: RelicSetEffect

SetDetailSetEffect pydantic-model

Represent a relic set detail's set effect.

Attributes:

Fields:

Validators:

  • __format_fields
  • __format_parameters

description pydantic-field

description: str

parameters pydantic-field

parameters: list[float]

SetDetailSetEffects pydantic-model

Represent relic set detail's set effects.

Attributes:

Fields:

Validators:

  • __format_fields

four_piece pydantic-field

four_piece: SetDetailSetEffect | None = None

two_piece pydantic-field

two_piece: SetDetailSetEffect

Skill pydantic-model

Represent a character's skill.

Attributes:

Fields:

Validators:

  • __format_fields

description pydantic-field

description: str | None = None

energy_generation pydantic-field

energy_generation: int | None = None

level_info pydantic-field

level_info: dict[str, SkillLevelInfo]

max_level property

max_level: int

Get the skill's maximum level.

name pydantic-field

name: str

tag pydantic-field

tag: str

type pydantic-field

type: str | None = None

SkillLevelInfo pydantic-model

Represent a skill's level information.

Attributes:

Fields:

Validators:

  • __format_fields

level pydantic-field

level: int

parameters pydantic-field

parameters: list[float]

SuperimposeInfo pydantic-model

Represent a light cone's superimpose information.

Attributes:

Fields:

Validators:

  • __format_fields
  • __flatten_parameters

description pydantic-field

description: str

name pydantic-field

name: str

parameters pydantic-field

parameters: dict[str, list[float]]