Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seriaati/hakushin-py
Async API wrapper for hakush.in written in Python
https://github.com/seriaati/hakushin-py
api-wrapper genshin-impact hakushin honkai-star-rail hoyoverse python star-rail
Last synced: 14 days ago
JSON representation
Async API wrapper for hakush.in written in Python
- Host: GitHub
- URL: https://github.com/seriaati/hakushin-py
- Owner: seriaati
- License: gpl-3.0
- Created: 2024-04-27T11:50:47.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-12-16T00:58:37.000Z (20 days ago)
- Last Synced: 2024-12-16T01:32:19.106Z (20 days ago)
- Topics: api-wrapper, genshin-impact, hakushin, honkai-star-rail, hoyoverse, python, star-rail
- Language: Python
- Homepage: https://pypi.org/project/hakushin-py/
- Size: 404 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hakushin-py
## Introduction
hakushin-py is an async API wrapper for [hakush.in](https://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](https://github.com/seriaati#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](https://github.com/seriaati/ambr) and [yatta.py](https://github.com/seriaati/yatta) 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](https://github.com/pydantic/pydantic), this also means full autocomplete support.## Installation
```bash
# poetry
poetry add hakushin-py# pip
pip install hakushin-py
```## Quick Example
```py
import hakushin
import asyncioasync 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](https://github.com/seriaati/hakushin-py/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](https://discord.com/invite/b22kMKuwbS), my username is @seria_ati.