Skip to main content

Async API wrapper for akasha.cv written in Python

Project description

akasha-py

Introduction

akasha-py is an async API wrapper for akasha.cv written in Python.
akasha.cv is a Genshin Impact leaderboard website.
Developing something for Hoyoverse games? You might be interested in other API wrappers written by me.

Note: I am not the developer of akasha.cv.

Important Notes

A couple things I want to address:

  • This wrapper is currently in-progress, some features may not work as expected, many features are also missing.
  • The developer of akasha.cv mentioned to me that they change their API very frequently (and without notice), so this wrapper may break at any time.
  • This wrapper was made because I wanted to integrate akasha into my Discord bot, but I eventually stopped working on it. Therefore, this wrapper is not my current priority, but I will fix issues if you submit them.

Installation

# poetry
poetry add akasha-py

# pip
pip install akasha-py

Usage

Interact with the API using the akasha.AkashaAPI class.
You can find all available methods that AkashaAPI provides in the client.py file.
A quick example is provided below:

import asyncio

import akasha


async def main() -> None:
    uid = 901211014
    async with akasha.AkashaAPI(akasha.Language.CHINESE_SIMPLIFIED) as api:
        # await api.refresh_user(uid)

        characters = await api.get_calculations_for_user(uid)
        for character in characters:
            calc = character.calculations[0]

            print(f"Character: {character.name}")
            print(f"Weapon: {calc.weapon.name}")
            print(f"Top {calc.top_percent:.2f}% ({calc.ranking}/{calc.out_of})")
            print(f"Damage: {round(calc.result)}")
            print()

            print("Leaderboard top 3:")
            async for board in api.get_leaderboards(calc.id, max_page=1, page_size=3):
                print(
                    f"{board.rank}. {board.owner.nickname} | Damage: {round(board.calculation.result)}"
                )
            print(f"Leadboard URL: https://akasha.cv/leaderboards/{calc.id}")

            print("=" * 50)


asyncio.run(main())

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

akasha_py-0.2.10.tar.gz (68.8 kB view details)

Uploaded Source

Built Distribution

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

akasha_py-0.2.10-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file akasha_py-0.2.10.tar.gz.

File metadata

  • Download URL: akasha_py-0.2.10.tar.gz
  • Upload date:
  • Size: 68.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.13

File hashes

Hashes for akasha_py-0.2.10.tar.gz
Algorithm Hash digest
SHA256 3a0a6a4a8c47fa06011c6a6dae61f647677b5114c433075db7410943856b26c9
MD5 3a882b3b6dc99fd7af24d5fc60b57215
BLAKE2b-256 3d86f58d836ca53396858adddaf4efd2665d7c20b15cb742a181d1c831555545

See more details on using hashes here.

File details

Details for the file akasha_py-0.2.10-py3-none-any.whl.

File metadata

  • Download URL: akasha_py-0.2.10-py3-none-any.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.13

File hashes

Hashes for akasha_py-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 9c8d1647524aee01a813d3a24c245c125ca287a83b5541e1c39b3417333e2e3a
MD5 9cf5583a7df540eacde65c7db102fbe7
BLAKE2b-256 9f158e14177b9d6f1407ad7ee29e18c3974e7f2c4cdd3faf88f98dd53221ecbc

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