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.
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, Contributions
For questions, you can contact me on Discord or open an issue.
To report issues with this wrapper, open an issue.
To contribute, fork this repo and submit a pull request.
Project details
Release history Release notifications | RSS feed
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.1.tar.gz
(21.6 kB
view hashes)
Built Distribution
akasha_py-0.2.1-py3-none-any.whl
(23.1 kB
view hashes)
Close
Hashes for akasha_py-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40b10aae60a2f64be948fb91401786584e46733ae4f800115f0cbd30a9dfe4bb |
|
MD5 | ba6f5c6df42d3e1e43a60f31d8206c2c |
|
BLAKE2b-256 | 56fceb6260dd3a2e876426fe1d6583cd55c5d84e96f1ee509e8f1221523cb459 |