corkus banner

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.
  • Implements most 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/[email protected]

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

GitHub

GitHub - MrBartusek/corkus.py: Asynchronous, feature-rich and easy to use Python wrapper for Public Wynncraft API ⚙️
Asynchronous, feature-rich and easy to use Python wrapper for Public Wynncraft API ⚙️ - GitHub - MrBartusek/corkus.py: Asynchronous, feature-rich and easy to use Python wrapper for Public Wynncraft...