Client
HSRClient
Bases: BaseClient
The main client to interact with the Enka Network Honkai Star Rail API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lang
|
Language | str
|
The language to use for the client, defaults to Language.ENGLISH. |
ENGLISH
|
headers
|
dict[str, Any] | None
|
The headers to use for the client, defaults to None. |
None
|
cache
|
BaseTTLCache | None
|
The cache to use for the client, defaults to None. |
None
|
use_enka_icons
|
bool
|
Whether to get stat icons from Enka, defaults to True. |
True
|
timeout
|
int
|
The timeout for the client, defaults to DEFAULT_TIMEOUT. |
DEFAULT_TIMEOUT
|
fetch_builds(owner)
async
Fetch the character builds of the given owner.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
owner
|
Owner | OwnerInput
|
The owner of the builds. |
required |
Returns:
Type | Description |
---|---|
dict[str, list[Build]]
|
Character ID to list of builds mapping. |
fetch_showcase(uid, *, raw=False, use_backup=False)
async
Fetch the player showcase of the given UID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid
|
str | int
|
The UID of the user. |
required |
raw
|
bool
|
Whether to return the raw data, defaults to False. |
False
|
use_backup
|
bool
|
Whether to force-use the backup API, defaults to False. |
False
|
Returns:
Type | Description |
---|---|
ShowcaseResponse | dict[str, Any]
|
The parsed or raw showcase data. |
parse_showcase(data)
Parse the given showcase data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict[str, Any]
|
The showcase data. |
required |
Returns:
Type | Description |
---|---|
ShowcaseResponse
|
The parsed showcase response. |
update_assets()
async
Update game assets.