mirror of
https://github.com/PaiGramTeam/EnkaNetwork.py.git
synced 2024-11-16 03:45:28 +00:00
Update README.md
- Update usage - Add Thai README.md
This commit is contained in:
parent
954fa0d629
commit
d8a87dac1d
24
README.md
24
README.md
@ -1,12 +1,14 @@
|
|||||||
# Enka Network Python
|
# Enka Network Python
|
||||||
|
EN | [TH](./README_TH.md)
|
||||||
|
|
||||||
Library for fetching JSON data from site https://enka.shinshin.moe/
|
Library for fetching JSON data from site https://enka.shinshin.moe/
|
||||||
|
|
||||||
# Installation
|
# 💾 Installation
|
||||||
```
|
```
|
||||||
pip install enkanetwork.py
|
pip install enkanetwork.py
|
||||||
```
|
```
|
||||||
|
|
||||||
# Usage
|
# ✨ Usage
|
||||||
```py
|
```py
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
@ -16,20 +18,34 @@ client = EnkaNetworkAPI()
|
|||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
data = await client.fetch_user(843715177)
|
data = await client.fetch_user(843715177)
|
||||||
|
print("=== Player Info ===")
|
||||||
print(f"Nickname: {data.player.nickname}")
|
print(f"Nickname: {data.player.nickname}")
|
||||||
print(f"Level: {data.player.level}")
|
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 = asyncio.get_event_loop()
|
||||||
loop.run_until_complete(main())
|
loop.run_until_complete(main())
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
=== Player Info ===
|
||||||
Nickname: mrwan2546
|
Nickname: mrwan2546
|
||||||
Level: 55
|
Level: 55
|
||||||
Cache timeout: 236
|
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](https://github.com/EnkaNetwork/API-docs)
|
If you want full docs for the API, visit [EnkaNetwork API Docs](https://github.com/EnkaNetwork/API-docs)
|
||||||
|
|
||||||
|
## Example
|
||||||
|
Please see in [example](./example/) folder.
|
||||||
|
|
||||||
# LICENSE
|
# LICENSE
|
||||||
[MIT License](./LICENSE)
|
[MIT License](./LICENSE)
|
||||||
|
55
README_TH.md
Normal file
55
README_TH.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# Enka Network Python
|
||||||
|
[EN](./README.md) | TH
|
||||||
|
|
||||||
|
ไลบารีสำหรับดึงข้อมูล JSON จากเว็บ https://enka.shinshin.moe
|
||||||
|
|
||||||
|
# 💾 วิธีการติดตั้ง
|
||||||
|
```
|
||||||
|
pip install enkanetwork.py
|
||||||
|
```
|
||||||
|
|
||||||
|
# ✨ วิธีใช้
|
||||||
|
```py
|
||||||
|
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())
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
=== 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
|
||||||
|
```
|
||||||
|
|
||||||
|
หากต้องการดูข้อมูล API เพิ่มเติม ไปดูที่ [EnkaNetwork API Docs](https://github.com/EnkaNetwork/API-docs)
|
||||||
|
|
||||||
|
## ตัวอย่างการใช้งาน
|
||||||
|
ดูได้ที่โฟเดอร์ [example](./example/)
|
||||||
|
|
||||||
|
# LICENSE
|
||||||
|
[MIT License](./LICENSE)
|
||||||
|
|
||||||
|
![น้อง Keqing น่ารัก 💗](https://c.tenor.com/MnkpnVCLcb0AAAAC/keqing-dance.gif)
|
||||||
|
|
||||||
|
[รูปจาก KKOMDASTRO](https://twitter.com/KKOMDASTRO)
|
Loading…
Reference in New Issue
Block a user