Skip to main content

Python API wrapper for exaroton

Project description

exaroton

A 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

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

exaroton-0.0.4.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exaroton-0.0.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file exaroton-0.0.4.tar.gz.

File metadata

  • Download URL: exaroton-0.0.4.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.0 Windows/10

File hashes

Hashes for exaroton-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a6318b6a4c5bb5a824c34062387c71c3c63a4968cfb084de2c78ac22e5bf2f3e
MD5 992fe6fc89e3e8111d905120a775c940
BLAKE2b-256 2f72cd97f7b615d85d1a6983c4382ca6a6f0ca61a2a212f9a3c5e2d772d8409d

See more details on using hashes here.

File details

Details for the file exaroton-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: exaroton-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.0 Windows/10

File hashes

Hashes for exaroton-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 41182f9972e95de009ab5820ee6979858d08c13b84d12d87cbe8caf5fd6cf488
MD5 75e3d7f6c5bea3891d2f032e0743b76f
BLAKE2b-256 cdb0498a0e77442f6d018032e4b277fa1dbf67d78cb2453afa253d08bf88465c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page