/Control-Wrapper

A simple Async API Wrapper for ControlPanel.gg.

Primary LanguagePythonMIT LicenseMIT

Control-Wrapper


Discord Contributors

What is this?

Control-Wrapper is an Async API Wrapper written in Python for the ControlPanel API. This is intended to make CPGG API calls easier to use for any endpoint.

Project Status

Currently this project is being maintained by Ferks-FK, and is in its initial stage (Alpha), so any bugs or problems you find, please open an issue on github. So far, this package is not on PyPi because it is still in its early stages.

How to install/Upgrade

At the moment you can test this package by installing the development version. You will need GIT installed to use the commands below.

To install:

pip install git+https://github.com/Ferks-FK/Control-Wrapper@development

To upgrade:

pip install --force-reinstall --no-deps git+https://github.com/Ferks-FK/Control-Wrapper@development

Usage Examples

Get all users

from control_wrapper import ControlWrapper as CPGG
import asyncio

api = CPGG("https://mydomain.com", "my token")

async def get_users():
    users = await api.user.list_users()
    print(users)
    
    return users
 
asyncio.run(get_users())

Get specific user using filters

from control_wrapper import ControlWrapper as CPGG
import asyncio

api = CPGG("https://mydomain.com", "my token")

async def get_users():
    users = await api.user.list_users(name="ferks", email="test@test.com", includes=['servers'])
    print(users)
    
    return users
 
asyncio.run(get_users())

Available Endpoints

Currently only a few endpoints are available, the rest will be implemented as the project develops. You can see the endpoints in the Docs.