mirror of
https://github.com/PaiGramTeam/EnkaNetwork.py.git
synced 2024-09-28 03:26:09 +00:00
Add new example
This commit is contained in:
parent
2b7daddc37
commit
88057efbc2
18
example/sync/main.py
Normal file
18
example/sync/main.py
Normal 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
3963
example/sync/raw.json
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user