A Python wrapper for the Wynncraft API
Project description
Corkus.py ⚙️
Asynchronous, feature-rich and easy to use Python wrapper for Public Wynncraft API.
Key Features
- Modern asynchronous API using
async
/await
syntax. - Easy to use with an object oriented design using
fetch
and helper functions. - 100% coverage of the Wynncraft API.
- Proper rate limit handling that prevents 429s.
- Responses caching to improve speed.
Installation
Python 3.8+ or higher is required
pip install corkus.py
Or install latest development version:
pip install --upgrade git+https://github.com/MrBartusek/corkus.py@main
See documentation for more information.
Quick Example
Using Context Manager:
import asyncio
from corkus import Corkus
async def player_stats():
async with Corkus() as corkus:
player = await corkus.player.get("Salted")
print(f"username: {player.username}")
print(f"chests_found: {player.statistics.chests_found}")
loop = asyncio.get_event_loop()
loop.run_until_complete(player_stats())
Without Context Manager:
import asyncio
from corkus import Corkus
async def player_stats():
corkus = Corkus()
player = await corkus.player.get("Salted")
print(f"username: {player.username}")
print(f"chests_found: {player.statistics.chests_found}")
await corkus.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(player_stats())
Output:
username: Salted
chests_found: 219
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
corkus.py-0.4.0.tar.gz
(37.4 kB
view hashes)
Built Distribution
corkus.py-0.4.0-py3-none-any.whl
(61.8 kB
view hashes)
Close
Hashes for corkus.py-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bea71a6720ebda085cbd170b1d8d4959a36bccb39442be7c79518d12b7837754 |
|
MD5 | 60ad8e36441ccc985945d2fd38c746e4 |
|
BLAKE2b-256 | 0afa64a3f7f0c9fa3e8a9ef32e58a9648f690db9d853e5880c3f7acef6da3642 |