Skip to main content

Exaroton API Wrapper

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.6+ Code style: black License: MIT

Installation

exaroton requires Python 3.6 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.2.tar.gz (6.0 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.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file Exaroton-0.0.2.tar.gz.

File metadata

  • Download URL: Exaroton-0.0.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for Exaroton-0.0.2.tar.gz
Algorithm Hash digest
SHA256 51a0dd4346a3cdff29a27c9c3dedc1010d55d501f045e00b1ac2d0fc38360abf
MD5 a25b2ef9efcb61d5234aae6780d91e10
BLAKE2b-256 f74bb450c6e77ef90d9a71733ba74c05e1064846f289a190d0a3f85b70de34f6

See more details on using hashes here.

File details

Details for the file Exaroton-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: Exaroton-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for Exaroton-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ccfbad8ac83937e54564e98203d9674d3265d50bcece5370f72e6bbf90557025
MD5 1eb837c0e67cc301609d4a3488fd2bc7
BLAKE2b-256 2cb6650bfcbabff6b0707de7c1f3cbdaba35eb6a5eaf9b54a5cbb5333b676142

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