Skip to content

A Python module to interact with the CoralMC API

Notifications You must be signed in to change notification settings

letruxux/coralmc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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())

Links

About

A Python module to interact with the CoralMC API

Resources

Stars

Watchers

Forks

Languages