Skip to main content

dragoraapi (Python)

Official Dragora panel API client for Python. Authenticate with a Dragora API key (dlpu_... for users, dpla_... for admins) or a legacy session token.

Install

pip install dragoraapi          # from PyPI
# or locally:
pip install -e .

Usage

from dragoraapi import DragoraAPI

# Use an API key (recommended) — no session_key needed.
api = DragoraAPI(
    url="http://localhost:8050",
    api_key="dlpu_your-user-api-key",
)

# Or a session token:
api = DragoraAPI(
    url="http://localhost:8050",
    token="<session-token>",
    session_key="<session-key>",
)

API keys

# Create a key (plaintext returned once)
api.create_api_key("my-bot", admin=True, expires_days=30)
# => {"token": "dpla_...", "api_key": {...}, ...}

api.list_api_keys()          # your masked keys
api.list_all_api_keys()      # admin: every key
api.revoke_api_key(key_id)   # revoke

Servers & resources

api.servers()
api.server(10)
api.server_power(10, "start")   # start | stop | restart | kill
api.server_console(10, "say hello")
api.server_logs(10)

api.files(10, "/plugins")
api.read_file(10, "server.properties")
api.write_file(10, "server.properties", "...")

api.databases(10)
api.create_database(10, {"database_name": "web", "password": "x", "database_host_id": 1})

api.admin_stats()   # admin-only
api.admin_users()

Errors

Non-2xx responses raise DragoraAPIError(status, message, data):

from dragoraapi import DragoraAPIError

try:
    api.admin_stats()
except DragoraAPIError as e:
    print(e.status, e.message)  # 403 ...

Keys

  • dlpu_ = user-scoped API key
  • dpla_ = admin-scoped API key (valid only for admin users; grants access to /panel/admin/* and /panel/nodes/* endpoints)

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dragoraapi-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

dragoraapi-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file dragoraapi-1.0.0.tar.gz.

File metadata

  • Download URL: dragoraapi-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for dragoraapi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 85b3787442e62d4eb06c99460252c2f9be4f9cb388ac855d99cda098d2de8fcf
MD5 4c41e00a7cdbd7df104554e2c7daef52
BLAKE2b-256 ca25664026ba539f07ecb7c450b4cdec447a1ed3d5290b515f27ebb36e6dc5ed

See more details on using hashes here.

File details

Details for the file dragoraapi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dragoraapi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for dragoraapi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3bf5bba86d24fb5d67a63d9eb60af737c6883da47dd62cf1a4b33808da2ab38
MD5 1fad461ede34c7fee8cbed3283ed6db6
BLAKE2b-256 bb9c2eb5e758b026d214076d39d89098e89dbf11c3b7c70d377ef327318620c0

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 Sentry Error logging StatusPage Status page