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

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 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.1.tar.gz (7.0 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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for hoyowrapper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a0d56ccdbe0bd153efb04b0109293eafa2dae63cd367dcf4601d10f3c99b6c69
MD5 585c32eee86487f2c676293699f859d4
BLAKE2b-256 398496f5b768de449aa10ede49a9dae483867c69a81e68eff6bfe4199700f4cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hoyowrapper-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d7f9455f40ca474a9eabff449d53f2015e1d6dc48b4d344bbdfcf839afac3cb4
MD5 f05b4bf0187e1184ebed1cd3604aa7e3
BLAKE2b-256 7bbfa2078ea231cca861952d46b0ae7d19c0f3674b97543551e5bade430c67f5

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