Skip to main content

Async API wrapper for hakush.in written in Python

Project description

hakushin-py

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.
Developing something for Hoyoverse games? You might be interested in other API wrappers written by me.

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, Feedback, Contributions

Whether you want to make any bug reports, feature requests, or contribute to the wrapper, simply open an issue or pull request in this repository.
If GitHub is not your type, you can find me on Discord, my username is @seria_ati.

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.10.tar.gz (80.7 kB view details)

Uploaded Source

Built Distribution

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

hakushin_py-0.4.10-py3-none-any.whl (57.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hakushin_py-0.4.10.tar.gz
  • Upload date:
  • Size: 80.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for hakushin_py-0.4.10.tar.gz
Algorithm Hash digest
SHA256 c05b6cbabdc2d1d3832923d9e6ab4d88a5c86d51dbd0b9d285b5546ec28751bc
MD5 4fa4b158b4612d65c9d3f478320d03af
BLAKE2b-256 aa8a7c3011e44166a111d5ed5a389100c6bfcc4abefba3392e02278a1f1d729d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hakushin_py-0.4.10-py3-none-any.whl
Algorithm Hash digest
SHA256 22fdf05e0f4dc4b6d7640efc71d9b5eeb0f62360932f785b86f99a16898b47f9
MD5 55900f5cb6472e22524270a805fdd2ce
BLAKE2b-256 74d090868e3849dc15a599de09fc28b8cbe5d9f2d4058232103c5335da9b16d0

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