Skip to main content

A Python module to interact with the CoralMC API

Project description

CoralMC

About

A Python module that allows you to interact with the CoralMC API.

Warning CoralMC's API is still in alpha and isn't documented. In the future an access token is going to be required. At the current state, it isn't recommended for production usage as it could stop working at any point.

Installation

python -m pip install coralmc

Example usage

Get basic player info:

import coralmc
import asyncio

async def main():
    try:
        playerInfo = await coralmc.getPlayerInfo("Feryzz")
        if playerInfo:
            print(playerInfo)
        else:
            print("Player not found!")
    except Exception as error:
        print(f"Error: {error}")

asyncio.run(main())

Get player stats:

import coralmc
import asyncio

async def main():
    try:
        playerStats = await coralmc.getPlayerStats("Feryzz")
        if playerStats:
            print(playerStats["kitpvp"])
            print(playerStats["bedwars"])
        else:
            print("Player not found!")
    except Exception as error:
        print(f"Error: {error}")

asyncio.run(main())

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

coralmc-1.0.1.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

coralmc-1.0.1-py3-none-any.whl (2.2 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