Module genshin.models.starrail.chronicle.characters

Starrail chronicle character.

Classes

class CharacterProperty (**data: Any)

Base character property.

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.

Expand source code
class CharacterProperty(APIModel):
    """Base character property."""

    property_type: int
    base: str
    add: str
    final: str
    preferred: bool
    recommended: bool
    info: PropertyInfo

Ancestors

Class variables

var add : str
var base : str
var final : str
var infoPropertyInfo
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var preferred : bool
var property_type : int
var recommended : bool
class ModifyRelicProperty (**data: Any)

Modify relic property.

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.

Expand source code
class ModifyRelicProperty(APIModel):
    """Modify relic property."""

    property_type: int
    modify_property_type: int

Ancestors

Class variables

var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var modify_property_type : int
var property_type : int
class PropertyInfo (**data: Any)

Relic property info.

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.

Expand source code
class PropertyInfo(APIModel):
    """Relic property info."""

    property_type: int
    name: str
    icon: str
    property_name_relic: str
    property_name_filter: str

Ancestors

Class variables

var icon : str
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var property_name_filter : str
var property_name_relic : str
var property_type : int
class Rank (**data: Any)

Character rank.

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.

Expand source code
class Rank(APIModel):
    """Character rank."""

    id: int
    pos: int
    name: str
    icon: str
    desc: str
    is_unlocked: bool

Ancestors

Class variables

var desc : str
var icon : str
var id : int
var is_unlocked : bool
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var pos : int
class RecommendProperty (**data: Any)

Character recommended and preferred properties.

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.

Expand source code
class RecommendProperty(APIModel):
    """Character recommended and preferred properties."""

    recommend_relic_properties: Sequence[int]
    custom_relic_properties: Sequence[int]
    is_custom_property_valid: bool

Ancestors

Class variables

var custom_relic_properties : collections.abc.Sequence[int]
var is_custom_property_valid : bool
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var recommend_relic_properties : collections.abc.Sequence[int]
class Relic (**data: Any)

Character relic.

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.

Expand source code
class Relic(APIModel):
    """Character relic."""

    id: int
    level: int
    pos: int
    name: str
    desc: str
    icon: str
    rarity: int
    wiki: str
    main_property: RelicProperty
    properties: Sequence[RelicProperty]

Ancestors

Class variables

var desc : str
var icon : str
var id : int
var level : int
var main_propertyRelicProperty
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var pos : int
var properties : collections.abc.Sequence[RelicProperty]
var rarity : int
var wiki : str
class RelicProperty (**data: Any)

Relic property.

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.

Expand source code
class RelicProperty(APIModel):
    """Relic property."""

    property_type: int
    value: str
    times: int
    preferred: bool
    recommended: bool
    info: PropertyInfo

Ancestors

Class variables

var infoPropertyInfo
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var preferred : bool
var property_type : int
var recommended : bool
var times : int
var value : str
class Skill (**data: Any)

Character skill.

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.

Expand source code
class Skill(APIModel):
    """Character skill."""

    point_id: str
    point_type: int
    item_url: str
    level: int
    is_activated: bool
    is_rank_work: bool
    pre_point: str
    anchor: str
    remake: str
    skill_stages: Sequence[SkillStage]

Ancestors

Class variables

var anchor : str
var is_activated : bool
var is_rank_work : bool
var item_url : str
var level : int
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var point_id : str
var point_type : int
var pre_point : str
var remake : str
var skill_stages : collections.abc.Sequence[SkillStage]
class SkillStage (**data: Any)

Character skill stage.

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.

Expand source code
class SkillStage(APIModel):
    """Character skill stage."""

    name: str
    desc: str
    level: int
    remake: str
    item_url: str
    is_activated: bool
    is_rank_work: bool

Ancestors

Class variables

var desc : str
var is_activated : bool
var is_rank_work : bool
var item_url : str
var level : int
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var remake : str
class StarRailDetailCharacter (**data: Any)

StarRail character with equipment and relics.

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.

Expand source code
class StarRailDetailCharacter(character.StarRailPartialCharacter):
    """StarRail character with equipment and relics."""

    image: str
    equip: Optional[StarRailEquipment]
    relics: Sequence[Relic]
    ornaments: Sequence[Relic]
    ranks: Sequence[Rank]
    properties: Sequence[CharacterProperty]
    path: StarRailPath = Aliased("base_type")
    figure_path: str
    skills: Sequence[Skill]

Ancestors

Class variables

var equip : Optional[StarRailEquipment]
var figure_path : str
var image : str
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var ornaments : collections.abc.Sequence[Relic]
var pathStarRailPath
var properties : collections.abc.Sequence[CharacterProperty]
var ranks : collections.abc.Sequence[Rank]
var relics : collections.abc.Sequence[Relic]
var skills : collections.abc.Sequence[Skill]
class StarRailDetailCharacters (**data: Any)

StarRail characters.

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.

Expand source code
class StarRailDetailCharacters(APIModel):
    """StarRail characters."""

    avatar_list: Sequence[StarRailDetailCharacter]
    equip_wiki: Mapping[str, str]
    relic_wiki: Mapping[str, str]
    property_info: Mapping[str, PropertyInfo]
    recommend_property: Mapping[str, RecommendProperty]
    relic_properties: Sequence[ModifyRelicProperty]

    @pydantic.model_validator(mode="before")
    def __fill_additional_fields(cls, values: Mapping[str, Any]) -> Mapping[str, Any]:
        """Fill additional fields for convenience."""
        characters = values.get("avatar_list", [])
        props_info = values.get("property_info", {})
        rec_props = values.get("recommend_property", {})
        equip_wiki = values.get("equip_wiki", {})
        relic_wiki = values.get("relic_wiki", {})

        for char in characters:
            char_id = str(char["id"])
            char_rec_props = rec_props[char_id]["recommend_relic_properties"]
            char_custom_props = rec_props[char_id]["custom_relic_properties"]

            for relic in char["relics"] + char["ornaments"]:
                prop_type = relic["main_property"]["property_type"]
                relic["main_property"]["info"] = props_info[str(prop_type)]
                relic["main_property"]["recommended"] = prop_type in char_rec_props
                relic["main_property"]["preferred"] = prop_type in char_custom_props

                for prop in relic["properties"]:
                    prop_type = prop["property_type"]
                    prop["recommended"] = prop_type in char_rec_props
                    prop["preferred"] = prop_type in char_custom_props
                    prop["info"] = props_info[str(prop_type)]

                relic["wiki"] = relic_wiki.get(str(relic["id"]), "")

            for prop in char["properties"]:
                prop_type = prop["property_type"]
                prop["recommended"] = prop_type in char_rec_props
                prop["preferred"] = prop_type in char_custom_props
                prop["info"] = props_info[str(prop_type)]

            if char["equip"]:
                char["equip"]["wiki"] = equip_wiki.get(str(char["equip"]["id"]), "")

        return values

Ancestors

Class variables

var avatar_list : collections.abc.Sequence[StarRailDetailCharacter]
var equip_wiki : collections.abc.Mapping[str, str]
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var property_info : collections.abc.Mapping[str, PropertyInfo]
var recommend_property : collections.abc.Mapping[str, RecommendProperty]
var relic_properties : collections.abc.Sequence[ModifyRelicProperty]
var relic_wiki : collections.abc.Mapping[str, str]
class StarRailEquipment (**data: Any)

Character equipment.

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.

Expand source code
class StarRailEquipment(APIModel):
    """Character equipment."""

    id: int
    level: int
    rank: int
    name: str
    desc: str
    icon: str
    rarity: int
    wiki: str

Ancestors

Class variables

var desc : str
var icon : str
var id : int
var level : int
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var rank : int
var rarity : int
var wiki : str
class StarRailPath (value, names=None, *, module=None, qualname=None, type=None, start=1)

StarRail character path.

Expand source code
class StarRailPath(enum.IntEnum):
    """StarRail character path."""

    DESTRUCTION = 1
    THE_HUNT = 2
    ERUDITION = 3
    HARMONY = 4
    NIHILITY = 5
    PRESERVATION = 6
    ABUNDANCE = 7

Ancestors

  • enum.IntEnum
  • builtins.int
  • enum.Enum

Class variables

var ABUNDANCE
var DESTRUCTION
var ERUDITION
var HARMONY
var NIHILITY
var PRESERVATION
var THE_HUNT