A library for handling interactions with Hoyolab via Python.
Project description
HoyoWrapper
HoyoWrapper is a Python library designed to interact with HoYoverse's HoYoLab. It provides a simple and efficient way to access various endpoints and perform operations.
Installation
To install HoyoWrapper, use pip:
pip install hoyowrapper
Usage
Functions in HoyoWrapper are all asynchronous and need to be run using asyncio. Here is a basic example of how to use HoyoWrapper:
from hoyowrapper import Tools, Genshin
import asyncio
user_cookies = asyncio.run(Tools.login())
# Example function call
response = asyncio.run(Genshin.check_in(user_cookies))
print(response)
Available Functions
HoyoLab
get_user_info(self, user_id: str)
Fetches information about a user.
- Parameters:
user_id(str): The ID of the user to fetch information for.
- Returns:
dict: A dictionary containing user information.
Genshin
act_calender(cookies: str) -> dict
Retrieve the act calender for Genshin Impact.
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the act calender.
check_in(cookies: str, lang: str = "en-us") -> str
Completes the daily check-in for Genshin Impact, giving rewards directly to the user's account
- Parameters:
cookies(str): The user's cookies, used to authenticate the request.lang(str): The language to receive responses in.
- Returns:
str: A string containing the response from the check-in request.
overview(server: str, uid: int, cookies: str) -> dict
Retrieves an overview of the player's game data.
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the player's game data.
characters(server: str, uid: int, cookies: str) -> dict
Retrieves data for every character owned by the specified player.
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the player's character data.
character_detailed(server: str, uid: int, character_id: int, cookies: str) -> dict
Retrieves detailed information for a character owned by the user
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.character_id(int) : The id of the character to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the character's data.
spiral_abyss(server: str, uid: int, cookies: str) -> dict
Get the player's spiral abyss data for genshin impact
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: Data of the player's spiral abyss progress.
imaginarium_theatre(server: str, uid: int, cookies: str) -> dict
Get the player's imaginarium theatre data for genshin impact
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: Data of the player's imaginarium theatre progress.
Star Rail
regions(cookies: str) -> dict
Get a list of all regions for Honkai Star Rail.
- Parameters:
cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the player's game data.
act_calender(cookies: str) -> dict
Retrieve the act calender for Honkai Star Rail.
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the act calender.
overview(server: str, uid: int, cookies: str) -> dict
Retrieves an overview of the player's game data.
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the player's game data.
characters(server: str, uid: int, cookies: str) -> dict
Retrieves data for every character owned by the specified player.
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the player's character data.
simulated_universe(server: str, uid: int, cookies: str) -> dict
Retrieves data for divergent universe, simulated universe, and expansion module progress.
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the player's progress data for simulated universe.
treasures_lightward(server: str, uid: int, cookies: str) -> dict
Retrieves data for forgotten hall, pure fiction, and apocalyptic shadow progress.
- Parameters:
server(str): The server name in which the account is saveduid(int): The player id of the account to look for.cookies(str): The user's cookies, used to authenticate the request.
- Returns:
dict: A dictionary containing the player's progress data for treasures lightward.
Contributing
Contributions are welcome via pull requests. Please ensure your changes pass existing tests and follow the project's coding style and conventions.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hoyowrapper-0.1.2.tar.gz.
File metadata
- Download URL: hoyowrapper-0.1.2.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
449c990265a8923ef73733a54b19467dd78f4ea75729928d8b823563c6a1279c
|
|
| MD5 |
edcae85e38afa4ff3028fa92deb66393
|
|
| BLAKE2b-256 |
8f04639017bcbd3b8bcadc9947bcb1f208396aba1a96afe7d1899a2050b4d8fe
|
File details
Details for the file hoyowrapper-0.1.2-py3-none-any.whl.
File metadata
- Download URL: hoyowrapper-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a716bf2474b3a403829f4a4f94d9416ac7ffa9daeea10090563c25ca326772b7
|
|
| MD5 |
451aad268bfcde5c7d58e3dc55a5c1b4
|
|
| BLAKE2b-256 |
88670d6b888df9d962536a69e7bfd4375425c27367076d27e23e825c5e1876aa
|