Skip to main content

Python CLI and SDK for Appliku

Project description

appliku

PyPI version License: MIT Python 3.10+

Python CLI and SDK for the Appliku cloud deployment platform.

Appliku is a PaaS that lets you deploy applications, manage infrastructure, and scale services — all from a single unified interface. This package provides both a programmatic Python SDK and a fully-featured command-line interface.

Installation

pip install appliku

UV users:

uv add appliku

Quick Start (SDK)

from appliku import Appliku

client = Appliku(token="your-api-token")

# List apps in a team
apps = client.apps.list("my-team")
for app in apps.results:
    print(f"{app.name}{app.status}")

# Trigger a deployment
deployment = client.apps.deploy("my-team", app_id=42)
print(f"Deployment {deployment.id} is {deployment.status}")

Authentication

There are three ways to authenticate:

  1. Constructor parameter: Appliku(token="tok_...")
  2. Environment variable: export APPLIKU_TOKEN=tok_...
  3. CLI login (saves token to ~/.config/appliku/config.toml):
    appliku login --email you@example.com --password secret
    

The SDK checks these sources in order: explicit token → APPLIKU_TOKEN env var → config file.

SDK Usage

Teams

# List teams
teams = client.teams.list()

# Create a team
team = client.teams.create("my-team-slug", "My Team")

# Update and delete
client.teams.update("my-team-slug", name="Renamed Team")
client.teams.delete("my-team-slug")

Apps

# List apps
apps = client.apps.list("my-team")

# Create an app
app = client.apps.create(
    "my-team",
    name="web-app",
    branch="main",
    git_url="https://github.com/user/repo.git",
    build_pack="dockerfile",
)

# Deploy
deployment = client.apps.deploy("my-team", app.id)

# Config vars
vars = client.apps.get_config_vars("my-team", app.id)
client.apps.set_config_vars("my-team", app.id, {"DATABASE_URL": "postgres://...", "DEBUG": "false"})

Deployments

# List deployments
deployments = client.deployments.list("my-team", app_id=42)

# Get latest
latest = client.deployments.latest("my-team", app_id=42)

# Stream logs in real-time
for log in client.deployments.stream_logs("my-team", app_id=42, deployment_id=latest.id):
    print(f"[{log.timestamp}] {log.message}")

Datastores

# Create a database
db = client.datastores.create("my-team", app_id=42, name="primary-db", engine="postgres", version="15")

# Lifecycle management
client.datastores.stop("my-team", 42, db.id)
client.datastores.start("my-team", 42, db.id)
client.datastores.restart("my-team", 42, db.id)

Domains & Volumes

# Domains
domain = client.domains.create("my-team", app_id=42, domain="app.example.com")
client.domains.delete("my-team", 42, domain.id)

# Volumes
vol = client.volumes.create("my-team", app_id=42, name="data", container_path="/data")
client.volumes.update("my-team", 42, vol.id, name="user-data")

Cron Jobs

cron = client.cron_jobs.create(
    "my-team", app_id=42,
    name="cleanup", schedule="0 2 * * *", command="python manage.py cleanup"
)
client.cron_jobs.update("my-team", 42, cron.id, is_disabled=True)

Clusters & Servers

# Create a cluster
cluster = client.clusters.create("my-team", name="production")

# Provision servers
do_server = client.servers.create_digitalocean("my-team", name="web-1", region="nyc1", size="s-2vcpu-2gb")
ec2_server = client.servers.create_ec2("my-team", name="worker-1", region="us-east-1", instance_type="t3.large")
custom_server = client.servers.create_custom("my-team", name="bare-metal", host="203.0.113.1")

CLI Usage

Authentication

appliku login --email you@example.com --password secret
appliku whoami
appliku logout

Apps

appliku apps list --team my-team
appliku apps create --team my-team --name web-app --branch main --git-url https://github.com/user/repo.git
appliku apps deploy --team my-team --app 42
appliku apps config --team my-team --app 42
appliku apps set-config --team my-team --app 42 --var FOO=bar --var BAZ=qux

Deployments

appliku deployments list --team my-team --app 42
appliku deployments latest --team my-team --app 42
appliku deployments logs --team my-team --app 42 --deployment 7 --stream

Datastores

appliku datastores create --team my-team --app 42 --name primary-db --engine postgres --version 15
appliku datastores start --team my-team --app 42 1
appliku datastores stop --team my-team --app 42 1

All commands support --output json for scripting:

appliku apps list --team my-team --output json

CLI Reference

Command Group Subcommands
(root) login, logout, whoami
teams list, get, create, update, delete
apps list, get, create, update, delete, deploy, config, set-config
deployments list, latest, logs
datastores list, create, delete, start, stop, restart
domains list, create, delete
volumes list, create, update, delete
crons list, create, update, delete
clusters list, create, delete
servers list, create-do, create-ec2, create-custom
invites list, create, delete, accept, decline
migrations list, run, logs

Error Handling

The SDK raises typed exceptions so you can handle specific failure modes:

from appliku import Appliku, NotFoundError, AuthenticationError, RateLimitError

client = Appliku()

try:
    app = client.apps.get("my-team", app_id=999)
except NotFoundError as e:
    print(f"App not found: {e}")
except AuthenticationError:
    print("Invalid or expired token")
except RateLimitError:
    print("Too many requests — retried automatically")

Exception hierarchy:

  • AplikuError (base)
    • AuthenticationError — 401
    • AuthorizationError — 403
    • NotFoundError — 404
    • ValidationError — 400 (field-level errors)
    • RateLimitError — 429 (auto-retried)
    • ServerError — 5xx (auto-retried with backoff)

License

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

appliku-0.1.0.tar.gz (68.1 kB view details)

Uploaded Source

Built Distribution

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

appliku-0.1.0-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file appliku-0.1.0.tar.gz.

File metadata

  • Download URL: appliku-0.1.0.tar.gz
  • Upload date:
  • Size: 68.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"42","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for appliku-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1468912bdd1f1d34c76501fe8a17df6b74401679f5f7a0f612c53a774ab82c4f
MD5 91d7bdf824c9106a55ea3cdedda72819
BLAKE2b-256 f3278d628372c2b5320d6bd7a3294cacb5ee6d8c5f6df9e9313dfe974f7fdfff

See more details on using hashes here.

File details

Details for the file appliku-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: appliku-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"42","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for appliku-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bfd38a911070efc503361f1428b96e8f89397cfdb8db57000570e2fd00db589
MD5 89c00ed020318558e145f7dee3d3b34e
BLAKE2b-256 b2636ae7c830598df5b2d6d58517c011cc501d2883b652d762c152c82be358d2

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