Skip to main content

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

Here is a basic example of how to use HoyoWrapper:

from hoyowrapper import HoyoLab, Genshin

user_cookies = HoyoLab.login()

# Example function call
response = 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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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 saved
    • uid (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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hoyowrapper-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hoyowrapper-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file hoyowrapper-0.1.0.tar.gz.

File metadata

  • Download URL: hoyowrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for hoyowrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df354ae8b07628c6931ec98f55f6f0d3d867cc9ba6568a3cdb07c179b4ebfe3b
MD5 bdd7241dbe32612593fe5ab2c28642af
BLAKE2b-256 0508401b034af7db1b8eaa8b95f5fc1475423e9f1e32be1e397623d483b0aebb

See more details on using hashes here.

File details

Details for the file hoyowrapper-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hoyowrapper-0.1.0-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

Hashes for hoyowrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50ca6ec38a179a61826b5d629579f907268a67b6014a145a8ef939aa08343563
MD5 43469616f93cd50ba4a5633bb3742205
BLAKE2b-256 ce322e663b57895c0ac828995514bf3cdbf48986c848586fb38a4bb914c559dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page