Skip to main content

Asynchronous, feature-rich and easy to use Python wrapper for Public 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

  • 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"logins: {player.statistics.logins}")

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"logins: {player.statistics.logins}")

    await corkus.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(player_stats())

Output:

username: Salted
logins: 1022

Contributing

Want to contribute to the project?

First of all, thanks! Check contributing guidelines for more information.

Links

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

Uploaded Source

Built Distribution

corkus.py-2.0.0-py3-none-any.whl (69.6 kB view hashes)

Uploaded Python 3

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