2022-06-22 06:14:31 +00:00
|
|
|
# Enka Network Python
|
2022-07-05 06:35:54 +00:00
|
|
|
EN | [TH](./README_TH.md)
|
|
|
|
|
2022-07-15 16:43:08 +00:00
|
|
|
Library for fetching JSON data from site https://enka.network/
|
2022-06-22 06:14:31 +00:00
|
|
|
|
2022-07-05 06:35:54 +00:00
|
|
|
# 💾 Installation
|
2022-06-22 06:14:31 +00:00
|
|
|
```
|
2022-06-22 06:18:36 +00:00
|
|
|
pip install enkanetwork.py
|
2022-06-22 06:14:31 +00:00
|
|
|
```
|
|
|
|
|
2022-07-16 19:33:34 +00:00
|
|
|
|
2022-07-05 06:35:54 +00:00
|
|
|
# ✨ Usage
|
2022-06-22 06:14:31 +00:00
|
|
|
```py
|
|
|
|
import asyncio
|
|
|
|
|
|
|
|
from enkanetwork import EnkaNetworkAPI
|
|
|
|
|
|
|
|
client = EnkaNetworkAPI()
|
|
|
|
|
|
|
|
async def main():
|
|
|
|
data = await client.fetch_user(843715177)
|
2022-07-05 06:35:54 +00:00
|
|
|
print("=== Player Info ===")
|
2022-06-22 06:14:31 +00:00
|
|
|
print(f"Nickname: {data.player.nickname}")
|
|
|
|
print(f"Level: {data.player.level}")
|
2022-07-16 19:33:34 +00:00
|
|
|
print(f"Icon: {data.player.icon.url}")
|
2022-07-05 06:35:54 +00:00
|
|
|
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}")
|
2022-06-22 06:14:31 +00:00
|
|
|
|
|
|
|
loop = asyncio.get_event_loop()
|
|
|
|
loop.run_until_complete(main())
|
|
|
|
```
|
|
|
|
|
|
|
|
```sh
|
2022-07-05 06:35:54 +00:00
|
|
|
=== Player Info ===
|
2022-06-22 06:14:31 +00:00
|
|
|
Nickname: mrwan2546
|
|
|
|
Level: 55
|
2022-07-16 19:33:34 +00:00
|
|
|
Icon: https://enka.network/ui/UI_AvatarIcon_Kazuha.png
|
|
|
|
Signature: K A Z U H A M U C H <3
|
|
|
|
Achievement: 396
|
2022-07-05 06:35:54 +00:00
|
|
|
Abyss floor: 8 - 3
|
|
|
|
Cache timeout: 300
|
2022-06-22 06:14:31 +00:00
|
|
|
```
|
|
|
|
|
2022-07-05 06:35:54 +00:00
|
|
|
If you want full docs for the API, visit [EnkaNetwork API Docs](https://github.com/EnkaNetwork/API-docs)
|
|
|
|
|
2022-07-05 08:45:53 +00:00
|
|
|
## 🌎 Languages Supported
|
|
|
|
| Languege | Code |
|
|
|
|
|-------------|---------|
|
|
|
|
| English | en |
|
2022-07-16 19:33:34 +00:00
|
|
|
| русский | ru |
|
2022-07-05 08:45:53 +00:00
|
|
|
| Tiếng Việt | vi |
|
|
|
|
| ไทย | th |
|
|
|
|
| português | pt |
|
|
|
|
| 한국어 | kr |
|
|
|
|
| 日本語 | jp |
|
|
|
|
| 中文 | zh |
|
|
|
|
| Indonesian | id |
|
|
|
|
| français | fr |
|
|
|
|
| español | es |
|
|
|
|
| deutsch | de |
|
|
|
|
| Taiwan | cht |
|
|
|
|
| Chinese | chs |
|
|
|
|
|
|
|
|
## 👀 Example
|
2022-07-05 06:35:54 +00:00
|
|
|
Please see in [example](./example/) folder.
|
2022-06-22 06:14:31 +00:00
|
|
|
|
2022-07-05 08:45:53 +00:00
|
|
|
# 📄 LICENSE
|
2022-06-22 06:14:31 +00:00
|
|
|
[MIT License](./LICENSE)
|
|
|
|
|
|
|
|
![Keqing](https://c.tenor.com/MnkpnVCLcb0AAAAC/keqing-dance.gif)
|
|
|
|
|
|
|
|
[Picture by KKOMDASTRO](https://twitter.com/KKOMDASTRO)
|