Skip to main content

Async API wrapper for hakush.in written in Python.

Project description

hakushin-py

Quick links

Developing something for Hoyoverse games? Here's a collection of Python async API wrappers for Hoyoverse games made by me:

  • enka.py is an Enka Network API wrapper for fetching in-game showcase.
  • yatta.py is a Project Yatta API wrapper for fetching Honkai Star Rail game data.
  • ambr.py is a Project Ambr API wrapper for fetching Genshin Impact game data.
  • hakushin.py is a Hakushin API wrapper for fetching Genshin Impact and Honkai Star Rail beta game data and ZZZ game data.

Introduction

hakushin-py is an async API wrapper for hakush.in written in Python.
hakush.in is a website that displays Genshin Impact, Honkai Star Rail, Zenless Zone Zero, and Wuthering Waves game data.

Note: I am not the developer of hakush.in

Important Note

This wrapper does not support all endpoints from hakush.in, it is mainly focused on fetching the beta game data.
This means I selectively chose the endpoints and API fields that I personally think are useful for theorycrafting.
If you want a more complete wrapper for game data, use ambry.py and yatta.py instead.
However, there is an exception for ZZZ, since Project Ambr and Yatta has no equivalent for ZZZ, this wrapper supports all endpoints for the ZZZ Hakushin API.
Regarding Wuthering Waves support for this wrapper, it is currently not planned.

Features

  • Fully typed.
  • Fully asynchronous by using aiohttp, and asyncio, suitable for Discord bots.
  • Provides direct icon URLs.
  • Supports Python 3.11+.
  • Supports all game languages.
  • Supports persistent caching using SQLite.
  • Supports Pydantic V2, this also means full autocomplete support.

Installation

# poetry
poetry add hakushin-py

# pip
pip install hakushin-py

Quick Example

import hakushin
import asyncio

async def main() -> None:
    async with hakushin.HakushinAPI(hakushin.Game.GI, hakushin.Language.EN) as client:
        await client.fetch_characters()
    async with hakushin.HakushinAPI(hakushin.Game.HSR, hakushin.Language.JA) as client:
        await client.fetch_light_cones()
    async with hakushin.HakushinAPI(hakushin.Game.ZZZ, hakushin.Language.KO) as client:
        await client.fetch_weapons()

asyncio.run(main())

Getting Started

Read the wiki to learn more about on how to use this wrapper.

Questions, Issues, Contributions

For questions, you can contact me on Discord or open an issue.
To report issues with this wrapper, open an issue.
To contribute, fork this repo and submit a pull request.

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

hakushin_py-0.4.4.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

hakushin_py-0.4.4-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file hakushin_py-0.4.4.tar.gz.

File metadata

  • Download URL: hakushin_py-0.4.4.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1025-azure

File hashes

Hashes for hakushin_py-0.4.4.tar.gz
Algorithm Hash digest
SHA256 fd77fe12fffcef2f29d504786f273ba31a37b00d04c0436e4fdd821235712fa0
MD5 a947b65d059d80530b2e4bc5b6528569
BLAKE2b-256 e81d239bcc9d7bc9e107500899fd33cec38c795fe7fac5d0c52af92e08fa1fc6

See more details on using hashes here.

File details

Details for the file hakushin_py-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: hakushin_py-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 44.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1025-azure

File hashes

Hashes for hakushin_py-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9f7151a75f9c6cbdc28d8e0c112871212bc4791920dbbb8d7c2ddba41c10405c
MD5 4caf64c37a43754f8f7f1a89d47d3595
BLAKE2b-256 a652b0cf44b9ead43134a55c56ebacaa32df90962e77c954847f4f1ad857beb0

See more details on using hashes here.

Supported by

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