pykagapi - a python wrapper for King Arthurs Gold-related APIs (KAG API v1 and KAG Stats API). Use it as you please, feel free to contribute!
- python 3.10+
- requests
- aiohttp (for async client)
- Install poetry
- Clone this repo:
git clone https://github.com/moonburnt/pykagapi.git
- Enter project's directory:
cd pykagapi
poetry install
pip install pykagapi
from pykagapi import kag
with kag.get_client() as c:
print(c.get_api_info())
from pykagapi import kag
import asyncio
async def main():
async with kag.get_async_client() as c:
print(await c.get_api_info())
asyncio.run(main())
from pykagapi import kag
with kag.get_client() as c:
servers_amount = len(kag.extra.get_active_servers()["serverList"])
print(f"There are currently {servers_amount} servers with players!")
Example output:
There are currently 6 servers with players!
- Everything that isn't "get" requests, because Im just a regular player and dont have ability to upload or remove anything
https://kagstats.com/api/players/{id}/refresh
, because it doesnt seem to do anything- Whatever I didnt notice while casually reading api's source codes
- Support for non-GET requests
- Automated tests
- Support for "limit"/"start" in list views of kagstats api
- Make async client optional