Skip to content

ColinShark/exaroton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

exaroton

An unoffial Python Wrapper for the exaroton API

Simply get an API Token from your Account and you're good to go.

Python: 3.7+ Code style: black License: MIT

Installation

exaroton requires Python 3.7 or newer.

python3 -m pip install -U exaroton

A Virtual Environment is recommended to not mess with system installs. This module has minimal requirements (requests), but you can never be safe enough.

python3 -m venv venv
source ./venv/bin/activate
pip install exaroton

Example Usage

Currently all methods are (in my opinion) well documented and properly typehinted. If you see something wrong, don't hestitate to create an Issue.

I may create a full list of all available methods, or even utilize readthedocs.org

# Import exaroton and set our token
>>> from exaroton import Exaroton
>>> exa = Exaroton("API_TOKEN")

# Get information about the authenticated account
>>> exa.get_account()
{
    "_": "Account",
    "name": "Username",
    "email": "email@example.org",
    "verified": true,
    "credits": 420.69
}

# Get a list of our servers
>>> exa.get_servers()
[
    {
        "_": "Server",
        "id": "7ZxuNK5RX879BFaH",  # Thanks, random.org!
        ...
    },
    {
        "_": "Server",
        "id": "Kf48Td5iVlr8Xu24",  # Thanks, random.org!
        ...
    }
]

# Upload logs to https://mclo.gs
>>> exa.upload_logs("7ZxuNK5RX879BFaH")
{
    "_": "Logs",
    "id": "N5FR4K2",  # Thanks, random.org!
    "url": "https://mclo.gs/N5FR4K2",
    "raw": "https://api.mclo.gs/1/raw/N5FR4K2"
}

# Print logs (this'll most likely spam your output lol)
>>> exa.get_server_logs("7ZxuNK5RX879BFaH")
'one extremely long string with lines seperated by the newline escape character \n'
# It'll print each line seperately when used with `print()`!

All you need to make calls to the API is the Authentication Token you can get from your account page. If you make server-specific calls, you'll need that servers ID, too.

The boring stuff

Licensed under MIT

About

Python API wrapper for exaroton

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages