Skip to content

Client

hsr

Classes:

  • HSRClient

    The main client to interact with the Enka Network Honkai Star Rail API.

HSRClient

The main client to interact with the Enka Network Honkai Star Rail API.

Parameters:

  • lang

    (Language | str, default: ENGLISH ) –

    The language to use for the client, defaults to Language.ENGLISH.

  • headers

    (dict[str, Any] | None, default: None ) –

    The headers to use for the client, defaults to None.

  • cache

    (BaseTTLCache | None, default: None ) –

    The cache to use for the client, defaults to None.

  • use_enka_icons

    (bool, default: True ) –

    Whether to get stat icons from Enka, defaults to True.

  • timeout

    (int, default: DEFAULT_TIMEOUT ) –

    The timeout for the client, defaults to DEFAULT_TIMEOUT.

Methods:

Attributes:

lang property writable

lang: Language

fetch_builds async

fetch_builds(owner: Owner | OwnerInput) -> dict[str, list[Build]]

Fetch the character builds of the given owner.

Parameters:

Returns:

fetch_showcase async

fetch_showcase(uid: str | int, *, raw: Literal[False] = False, use_backup: bool = ...) -> ShowcaseResponse
fetch_showcase(uid: str | int, *, raw: Literal[True] = True, use_backup: bool = ...) -> dict[str, Any]
fetch_showcase(uid: str | int, *, raw: bool = False, use_backup: bool = False) -> ShowcaseResponse | dict[str, Any]

Fetch the player showcase of the given UID.

Parameters:

  • uid
    (str | int) –

    The UID of the user.

  • raw
    (bool, default: False ) –

    Whether to return the raw data, defaults to False.

  • use_backup
    (bool, default: False ) –

    Whether to force-use the backup API, defaults to False.

Returns:

parse_showcase

parse_showcase(data: dict[str, Any]) -> ShowcaseResponse

Parse the given showcase data.

Parameters:

Returns:

start async

start() -> None

update_assets async

update_assets() -> None

Update game assets.