Skip to main content

A Python wrapper for the Wynncraft API

Project description

corkus banner

build codecov Documentation Status PyPI PyPI - Python Version

Corkus.py ⚙️

Asynchronous, feature-rich and easy to use Python wrapper for Public Wynncraft API.

Key Features

  • Asynchronous API using async and await
  • Easy to use with an object oriented design and fetch functions
  • ≈ 95% coverage of the Wynncraft API as of now
  • Proper rate limit handling
  • Responses caching

Missing Features

  • Item Database Endpoint
  • Wired search routes
  • Error handling

Installation

Python 3.8+ or higher is required

pip install corkus.py

Or install latest development version:

pip install git+https://github.com/MrBartusek/corkus.py@main

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

Project details


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.2.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page