Skip to main content

An async API wrapper for enka.network written in Python.

Project description

enka.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.

Introduction

enka.py is an async API wrapper for enka.network written in Python.

Features

  • Fully typed.
  • Fully asynchronous by using aiofiles, aiohttp, and asyncio, suitable for Discord bots.
  • Provides direct icon URLs.
  • Supports Python 3.10+.
  • Supports all game languages.
  • Supports both Genshin Impact and Honkai Star Rail.
  • Supports persistent caching using SQLite.
  • Supports Pydantic V2, this also means full autocomplete support.
  • Seamlessly integrates with GenshinData and StarRailData.

Installation

I know it's annoying that the project is named enka-py but the package is named enka-api. This is because the package name enka-py was already taken on PyPI.

# poetry
poetry add enka-api

# pip
pip install enka-api

Quick Example

import enka
import asyncio

async def main() -> None:
    async with enka.GenshinClient(enka.gi.Language.ENGLISH) as client:
      response = await client.fetch_showcase(901211014)
      print(response.player.nickname)
      print(response.characters[0].name)

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.
You can also join the Enka Network Discord server and find me in the enka-py channel.
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

enka_api-2.2.3.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

enka_api-2.2.3-py3-none-any.whl (45.2 kB view details)

Uploaded Python 3

File details

Details for the file enka_api-2.2.3.tar.gz.

File metadata

  • Download URL: enka_api-2.2.3.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1021-azure

File hashes

Hashes for enka_api-2.2.3.tar.gz
Algorithm Hash digest
SHA256 b5c8fb32a9eb6019208ed52391daa5e4bbc3d0b83080207464f8b11bb92f2cc4
MD5 3c4a978b49d6cd50b39e278959326488
BLAKE2b-256 bda566c8e092c7c46a513c9491533e1c4913aeaed09e2f8870b765220e9534f5

See more details on using hashes here.

Provenance

File details

Details for the file enka_api-2.2.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for enka_api-2.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b906f7205e4fa93a1f8f75ec85d16522afa3794fe260a54ff247002c5b73932e
MD5 38cb77d1e839a04f74aeccef45ff1539
BLAKE2b-256 c30b3c599215c8d1c07ede5fc30324f5d8e9e46139d57a03221df63c77b26c53

See more details on using hashes here.

Provenance

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