Skip to content

API Reference

calc_gi_chara_upgrade_stat_values(character, level, ascended)

Calculate the stat values of a GI character at a certain level and ascension status.

Parameters:

Name Type Description Default
character CharacterDetail

The character to calculate the stats for.

required
level int

The level of the character.

required
ascended bool

Whether the character is ascended.

required

Returns:

Type Description
dict[str, float]

A dictionary of stat values.

calc_hsr_chara_upgrade_stat_values(character, level, ascended)

Calculate the stat values of an HSR character at a certain level and ascension status.

Parameters:

Name Type Description Default
character CharacterDetail

The character to calculate the stats for.

required
level int

The level of the character.

required
ascended bool

Whether the character is ascended.

required

Returns:

Type Description
dict[str, float]

A dictionary of stat values.

calc_light_cone_upgrade_stat_values(light_cone, level, ascended)

Calculate the stat values of an HSR light cone at a certain level and ascension status.

Parameters:

Name Type Description Default
light_cone LightConeDetail

The light cone to calculate the stats for.

required
level int

The level of the light cone.

required
ascended bool

Whether the light cone is ascended.

required

Returns:

Type Description
dict[str, float]

A dictionary of stat values.

calc_weapon_upgrade_stat_values(weapon, level, ascended)

Calculate the stat values of a GI weapon at a certain level and ascension.

Parameters:

Name Type Description Default
weapon WeaponDetail

The weapon to calculate the stats for.

required
level int

The level of the weapon.

required
ascended bool

Whether the weapon is ascended.

required

Returns:

Type Description
dict[str, float]

A dictionary of stat values.

cleanup_text(text)

Remove HTML tags and sprite presets from a string.

Parameters:

Name Type Description Default
text str

The text to clean.

required

Returns:

Type Description
str

The cleaned text.

format_num(digits, calculation)

Format a number to a string with a fixed number of digits after the decimal point.

Parameters:

Name Type Description Default
digits int

Number of digits after the decimal point.

required
calculation float

Number to format.

required

Returns:

Type Description
str

The formatted number.

format_stat_values(values)

Format the stat values to a human-readable format.

Percentage values will be rounded to 1 decimal, while others will be rounded to the nearest integer.

Parameters:

Name Type Description Default
values dict[str, float]

A dictionary of fight prop ID and value.

required

Returns:

Type Description
dict[str, str]

A dictionary of formatted stat values.

get_ascension_from_level(level, ascended, game)

Get the ascension from the level and ascended status.

Parameters:

Name Type Description Default
level int

The level.

required
ascended bool

Whether the entity is ascended.

required
game Game

The game.

required

Returns:

Type Description
int

The ascension level.

get_max_level_from_ascension(ascension, game)

Get the max level from the ascension.

Parameters:

Name Type Description Default
ascension int

The ascension level.

required
game Game

The game.

required

Returns:

Type Description
int

The max level.

get_skill_attributes(descriptions, params)

Get the skill attributes from the descriptions.

Parameters:

Name Type Description Default
descriptions list[str]

The list of descriptions.

required
params list[int | float]

The list of parameters.

required

Returns:

Type Description
str

A string containing the skill attributes.

remove_ruby_tags(text)

Remove ruby tags from a string.

Parameters:

Name Type Description Default
text str

The text to process.

required

Returns:

Type Description
str

The text with ruby tags removed.

replace_device_params(text)

Replace device parameters in a string with the corresponding values.

replace_fight_prop_with_name(values, manual_weapon)

Replace the fight prop with the corresponding name.

Manual weapon example: https://gi.yatta.moe/api/v2/en/manualWeapon

Parameters:

Name Type Description Default
values dict[str, T]

A dictionary of fight prop ID and value.

required
manual_weapon dict[str, str]

A dictionary from project ambr with fight prop ID and value.

required

Returns:

Type Description
dict[str, T]

A dictionary with fight props replaced by names.

replace_layout(text)

Replace the layout in a string with the corresponding word.

Parameters:

Name Type Description Default
text str

The text to format.

required

Returns:

Type Description
str

The formatted text.

replace_params(text, param_list)

Replace parameters in a string with the corresponding values.

Parameters:

Name Type Description Default
text str

The text to replace the parameters in.

required
param_list list[float]

The list of parameters to replace the values with.

required

Returns:

Type Description
list[str]

The list of strings with the replaced parameters.

replace_placeholders(text, param_list)

Replace placeholders in the given text with values from the parameter list.

Parameters:

Name Type Description Default
text str

The text containing placeholders to be replaced.

required
param_list list[float]

The list of parameter values.

required

Returns:

Type Description
str

The text with placeholders replaced by their corresponding values.