Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CalagoAPI

The Python SDK for Calagopus.

CalagoAPI wraps the whole Calagopus API (servers, files, backups, databases, schedules, networking, your account, and full panel administration) in a small, hand-written API that reads like plain Python.

from calagoapi import Panel

panel = Panel(
    url='https://panel.example.com',
    api_key='c7sp_...'
)

server = panel.servers.getServer('abc123')
server.sendCommand('say Hello')
server.restart()

if server.isOnline():
    print(server.getStatus(), server.getRAM(), server.getUptime(formatted=True))

backup = server.createBackup('before-update')

If you have used HungerLib, you already know CalagoAPI. The same objects and method names (Panel, GenericServer, MinecraftServer, getStatus(), isOnline(), createBackup(), listFiles(), ...) work here, backed by Calagopus.

Installation

pip install calagoapi

CalagoAPI needs Python 3.9+ and depends on requests and websockets.

Features

Area What you can do
Servers Power actions, console commands, logs, live resources, status checks, rename, reinstall, timezone, auto-start, auto-kill, startup variables, docker image, server groups
Live console Stream console output over the daemon websocket, wait for a line, callbacks for output, status, stats and every daemon event, automatic token renewal and reconnects
Files List, read, write, upload, download, rename, move, copy (also to other servers), compress, decompress, chmod, search, pull from URL, file revisions, SQLite queries, directory sizes
Backups Create, restore, download, lock, rename, bulk delete, backup groups with retention policies, usage
Databases Hosted databases, dedicated database instances (PostgreSQL, MariaDB, MongoDB, Redis), database users and grants, import/export, a full database explorer (tables, columns, rows, queries)
Schedules Triggers (cron, crash, console line, resource usage, ...), conditions, 30+ step actions, import/export, live status, with builder helpers
Network Allocations, subdomains, per-server firewall, tunnels between servers
Subusers Invite, permissions, ignored files
Minecraft Version changer (install any Paper/Purpur/Fabric/... build), server.properties editing, EULA, console helpers
Account Profile, password, email, two-factor, API keys, SSH keys, passkeys, sessions, OAuth links, command snippets, activity
Admin Users, servers (create, deploy, transfer, suspend, limits), nodes, allocations, locations, nests and eggs, egg repositories, mounts, devices, roles, announcements, OAuth providers, database hosts, backup configurations and policies, settings, email templates, extensions, system health and updates
Async AsyncPanel: the whole API with await, plus a native asyncio live console
Reliability Automatic retries on rate limits (and on transient errors for reads), typed exceptions, automatic pagination

Quick tour

Status and resources

status = server.getStatus()        # 'running', 'offline', 'starting' or 'stopping'

if server.isOnline():
    print(server.getCPU(), '%')
    print(server.getRAM(), '/', server.getRAMLimit(), 'MiB')
    print(server.getUptime(formatted=True))  # '3h 12m'

server.isInstalled()
server.isSuspended()

Every important value has a getter and convenience checks, so you can inspect the exact state or just branch on it.

Live console

for line in server.streamConsole():
    if 'joined the game' in line:
        print(line)

with server.console as console:
    console.sendCommand('save-all')
    console.waitFor('Saved the game')

server.onConsoleLine(print)   # callbacks in a background thread

Async

from calagoapi import AsyncPanel

async with AsyncPanel(url='https://panel.example.com', api_key='c7sp_...') as panel:
    servers = await panel.servers.getServers()
    statuses = await asyncio.gather(*(server.getStatus() for server in servers))

    async for line in servers[0].streamConsole():
        print(line)

Files

for file in server.files.listFiles('/plugins'):
    print(file.getName(), file.getSize(formatted=True))

properties = server.readFile('/server.properties')
server.writeFile('/eula.txt', 'eula=true')
server.files.uploadFile('/plugins', 'build/MyPlugin.jar')
server.files.downloadFile('/world.zip', 'world.zip')

Backups

backup = server.createBackup('before-update')
backup.waitUntilComplete()

if backup.isSuccessful():
    print(backup.getSize(formatted=True))

backup.lock()
backup.restore(truncate_directory=True)

Schedules

from calagoapi import triggers, conditions, actions

server.schedules.createSchedule(
    'Nightly restart',
    triggers=[triggers.cron('0 0 4 * * *')],
    condition=conditions.serverState('running'),
    steps=[
        actions.sendCommand('say Restarting in 1 minute'),
        actions.sleep(60_000),
        actions.createBackup('nightly', foreground=True),
        actions.sendPower('restart'),
    ],
)

Databases

db = server.createDatabase('stats')
print(db.getConnectionString())

db.explorer.createTable('players', [
    {'name': 'id', 'type': 'INT', 'primary_key': True, 'auto_increment': True},
    {'name': 'name', 'type': 'VARCHAR(32)'},
])
db.explorer.insertRow('players', {'name': 'Steve'})
print(db.explorer.query('SELECT COUNT(*) FROM players'))

Minecraft

server = panel.servers.getMinecraftServer('abc123')

server.say('Server update in 5 minutes!')
server.setProperties({'max-players': 100, 'motd': 'Welcome!'})

latest = server.getBuilds('PAPER', '1.21.1', page=1, per_page=1)[0]
server.installVersion(latest)

Administration

user = panel.admin.users.createUser('steve', 'steve@example.com')

server = panel.admin.servers.deployServer(
    'Steve SMP', owner=user, egg=panel.admin.nests.findEgg('Paper'),
    locations=[panel.admin.locations.getLocationByName('Frankfurt')],
    memory=4096, disk=20480,
)

for node in panel.admin.nodes.getNodes():
    print(node.getName(), node.getSystemOverview()['version'])

Errors

from calagoapi import NotFoundError, PermissionDeniedError, CalagoAPIError

try:
    panel.servers.getServer('missing')
except NotFoundError:
    print('No such server')
except CalagoAPIError as e:
    print(e.status_code, e.errors)

Documentation

The docs folder has a guide for every area:

Every public class and method also has a docstring with parameters and an example, so help(server.files) works from a Python shell.

Development

pip install -e .[dev]
pytest

The tests run offline against openapi.json and a fake daemon. See Architecture.

License

GPL-3.0, see LICENSE.

Metadata

Release files for calagoapi 1.0.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for calagoapi 1.0.dev1
File Size Uploaded Provenance Actions
calagoapi-1.0.dev1.tar.gz 118.0 kB With provenance Details for calagoapi-1.0.dev1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for calagoapi 1.0.dev1
File Interpreter ABI Platform Actions
calagoapi-1.0.dev1-py3-none-any.whl Python 3 none any Details for calagoapi-1.0.dev1-py3-none-any.whl

Total release size: 253.2 kB

Release files / calagoapi-1.0.dev1.tar.gz

Download URL calagoapi-1.0.dev1.tar.gz
Size 118.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7bffc16a2badfbda50e74e829f1c98b7ba8440a48a4882d908bf4d8611652c43
BLAKE2b-256 checksum
How to use checksums
718bd267b78d3856dfb2092b106b0d4b4fa4653e254b46ddb22f0556dd5dbf01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / calagoapi-1.0.dev1-py3-none-any.whl

Download URL calagoapi-1.0.dev1-py3-none-any.whl
Size 135.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02994bc182ab1622d4793051d295246372aa0696df36ff6aec37c36a087732f4
BLAKE2b-256 checksum
How to use checksums
04253447e9ea2aba576efe888d7d9ae2c4b0b1118461c41ad08bee3ecf65c03b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for calagoapi 1.0.dev1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for calagoapi-1.0.dev1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page