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.7.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.7.0
File Size Uploaded Provenance Actions
enka-2.7.0.tar.gz 67.0 kB Without provenance Details for enka-2.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 140.3 kB

Release files / enka-2.7.0.tar.gz

Download URL enka-2.7.0.tar.gz
Size 67.0 kB
Tags Source
SHA-256 checksum
How to use checksums
85590a3079379e9eb2237c70f408cec5ceb3ee04b5a84e506adc11036652f6d9
BLAKE2b-256 checksum
How to use checksums
e2c3717c4f735654ea0674fc3eb1a89d6c90500832e9af0138efbdbe38b9893c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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.7.0-py3-none-any.whl

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

Security for enka 2.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

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