mirror of
https://github.com/PaiGramTeam/EnkaNetwork.py.git
synced 2024-11-16 03:45:28 +00:00
d8a87dac1d
- Update usage - Add Thai README.md
1.3 KiB
1.3 KiB
Enka Network Python
EN | TH
Library for fetching JSON data from site https://enka.shinshin.moe/
💾 Installation
pip install enkanetwork.py
✨ Usage
import asyncio
from enkanetwork import EnkaNetworkAPI
client = EnkaNetworkAPI()
async def main():
data = await client.fetch_user(843715177)
print("=== Player Info ===")
print(f"Nickname: {data.player.nickname}")
print(f"Level: {data.player.level}")
print(f"Icon: {data.player.profile_picture.icon}")
print(f"Signature: {data.player.signature}")
print(f"Achievement: {data.player.achievement}")
print(f"Abyss floor: {data.player.abyss_floor} - {data.player.abyss_room}")
print(f"Cache timeout: {data.ttl}")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
=== Player Info ===
Nickname: mrwan2546
Level: 55
Icon: https://enka.shinshin.moe/ui/UI_AvatarIcon_Hutao.png
Signature: ?
Achievement: 395
Abyss floor: 8 - 3
Cache timeout: 300
If you want full docs for the API, visit EnkaNetwork API Docs
Example
Please see in example folder.