Asynchronous, feature-rich and easy to use Python wrapper for Public 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("MrBartusekXD")
character = player.best_character
print(f"username: {player.username}")
print(f"best character: {character.display_name} ({character.combat.level}lv)")
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()
await corkus.start()
player = await corkus.player.get("MrBartusekXD")
character = player.best_character
print(f"username: {player.username}")
print(f"best character: {character.display_name} ({character.combat.level}lv)")
await corkus.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(player_stats())
Output:
username: MrBartusek
best character: Mage (102lv)
Contributing
Want to contribute to the project?
First of all, thanks! Check contributing guidelines for more information.
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-3.0.0.tar.gz
(43.2 kB
view hashes)
Built Distribution
corkus.py-3.0.0-py3-none-any.whl
(69.9 kB
view hashes)
Close
Hashes for corkus.py-3.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c269555a8ffc8653553b965ded85826c1c4dee829b5d37a8ffe2a0ab00299b8 |
|
MD5 | e260a1cf7dc8998d0bb2e1718327933e |
|
BLAKE2b-256 | 0f38515f0383fbf3c9d6a9f08dac409fbb6a0d8e4d8ed1773c3b0e5f5da339af |