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:
-
(langLanguage | str, default:ENGLISH) –The language to use for the client, defaults to Language.ENGLISH.
-
(headersdict[str, Any] | None, default:None) –The headers to use for the client, defaults to None.
-
(cacheBaseTTLCache | None, default:None) –The cache to use for the client, defaults to None.
-
(use_enka_iconsbool, default:True) –Whether to get stat icons from Enka, defaults to True.
-
(timeoutint, default:DEFAULT_TIMEOUT) –The timeout for the client, defaults to DEFAULT_TIMEOUT.
Methods:
-
fetch_builds–Fetch the character builds of the given owner.
-
fetch_showcase–Fetch the player showcase of the given UID.
-
parse_showcase–Parse the given showcase data.
-
start– -
update_assets–Update game assets.
Attributes:
fetch_builds
async
fetch_showcase
async
fetch_showcase(uid: str | int, *, raw: Literal[False] = False, use_backup: bool = ...) -> ShowcaseResponse
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:
-
(uidstr | int) –The UID of the user.
-
(rawbool, default:False) –Whether to return the raw data, defaults to False.
-
(use_backupbool, default:False) –Whether to force-use the backup API, defaults to False.
Returns:
-
ShowcaseResponse | dict[str, Any]–The parsed or raw showcase data.
parse_showcase
parse_showcase(data: dict[str, Any]) -> ShowcaseResponse
Parse the given showcase data.
Parameters:
Returns:
-
ShowcaseResponse–The parsed showcase response.