Skip to main content

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.

Metadata

Release files for enka 2.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enka 2.6.0
File Size Uploaded
enka-2.6.0.tar.gz 61.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for enka 2.6.0
File Interpreter ABI Platform
enka-2.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 132.9 kB

Release files / enka-2.6.0.tar.gz

Download URL enka-2.6.0.tar.gz
Size 61.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5afd91d00577a636084710f95acd31ee58929149305565f5311fbbf81b50c74c
BLAKE2b-256 checksum
How to use checksums
6650790218f14d3a022ef534dbb64a909c8e0ee9f0710bb435fd941be37fd455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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}

Release files / enka-2.6.0-py3-none-any.whl

Download URL enka-2.6.0-py3-none-any.whl
Size 71.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5225109a38ac576b255b4c6de276d72660edf94be29fe51b5b842ba84a3d8bc3
BLAKE2b-256 checksum
How to use checksums
eee7ff1a9a49fb77d1f1b36408f9a5967a0ad4b979e0c35d794efc075433e659
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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}

Release history Release notifications | RSS feed

This release

2.6.0 This release

2 release files

2.5.20

2 release files

2.5.19

2 release files

2.5.18

2 release files

2.5.17

2 release files

2.5.14

2 release files

2.5.13

2 release files

2.5.11

2 release files

2.5.10

2 release files

2.5.9

2 release files

2.5.8

2 release files

2.5.7

2 release files

2.5.6

2 release files

2.5.5

2 release files

2.5.4

2 release files

2.5.3

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.8

2 release files

2.4.7

2 release files

2.4.6

2 release files

2.4.5

2 release files

2.4.4

2 release files

2.4.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page