Skip to main content

Async API wrapper for Enka Network written in Python, supports GI, HSR, and ZZZ.

Project description

enka.py

⚠️ Notice: Package Renaming

The enka-api package has been deprecated and is now replaced by the new package named enka. Please install the new package:

pip install enka

The enka-api package will continue to be available, but new updates will be released in the enka package, so I encourage you to transition to the new package as soon as possible.

Introduction

enka.py is an async API wrapper for Enka Network written in Python.
Developing something for Hoyoverse games? You might be interested in other API wrappers written by me.

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 Genshin Impact, Honkai Star Rail, and Zenless Zone Zero.
  • Supports persistent caching using SQLite and allows custom caching strategies.
  • Implements stat calculations for HSR and ZZZ.
  • Uses Pydantic v2, this also means full autocomplete support.
  • Seamlessly integrates with GenshinData, StarRailData, and ZenlessData.

Installation

pip install enka

With optional dependencies:

# For SQLite caching
pip install enka[sqlite]

# For Redis caching
pip install enka[redis]

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 documentation 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

enka-2.5.19.tar.gz (60.8 kB view details)

Uploaded Source

Built Distribution

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

enka-2.5.19-py3-none-any.whl (70.0 kB view details)

Uploaded Python 3

File details

Details for the file enka-2.5.19.tar.gz.

File metadata

  • Download URL: enka-2.5.19.tar.gz
  • Upload date:
  • Size: 60.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for enka-2.5.19.tar.gz
Algorithm Hash digest
SHA256 c7b116c6bc2a31881e3404642e630ecf28df02ccd82d5ec64655d149cac448b2
MD5 04a57dcc23323abf5d0c530396af9aa5
BLAKE2b-256 24826c93bb6b02d24b97ee357bde44b8b14e85801075bc9740b1355f2004eea8

See more details on using hashes here.

File details

Details for the file enka-2.5.19-py3-none-any.whl.

File metadata

  • Download URL: enka-2.5.19-py3-none-any.whl
  • Upload date:
  • Size: 70.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for enka-2.5.19-py3-none-any.whl
Algorithm Hash digest
SHA256 0ead9b7b0011baf3e912f3801d04c6b8e5dd91af8ff4c9e4fe3311a01f07521b
MD5 d91a8faab9e9eb9f703665f1fbd91e5a
BLAKE2b-256 00f415f3cfb236a1c2f3080a7b8b877c28c481d972f3ffc2b6f233ca87be9461

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