Add new example

This commit is contained in:
M307 (Mac) 2023-02-17 01:26:24 +07:00
parent 2b7daddc37
commit 88057efbc2
2 changed files with 3981 additions and 0 deletions

18
example/sync/main.py Normal file
View File

@ -0,0 +1,18 @@
import asyncio
import json
from enkanetwork import EnkaNetworkAPI
client = EnkaNetworkAPI(lang="th")
async def main():
async with client:
# Load old data build
with open("./raw.json", "r") as f:
old = json.load(f)
export = await client.sync_build(old["uid"], old)
# Export new data
with open("./export.json", "w", encoding="utf-8") as w:
json.dump(export, w, indent=4)
asyncio.run(main())

3963
example/sync/raw.json Normal file

File diff suppressed because it is too large Load Diff