Skip to main content

pvesh-like CLI for Proxmox API with multi-backend support, performance profiling, and advanced configuration management

Project description

proxmox-sdk

Schema-driven FastAPI package for Proxmox API: OpenAPI generation, mock data, and in-memory CRUD operations.

📚 Full Documentation

Features

  • Dual Mode: Mock mode (default) for development, Real mode for production Proxmox integration
  • 646 Endpoints: Pre-generated Proxmox VE 9.1.11 API with full OpenAPI schema
  • Mock Data: Automatically generate mock data for all endpoints with in-memory CRUD
  • Real API Proxy: Validated proxy to real Proxmox VE API with request/response validation
  • Code Generation: Automatically crawl Proxmox API Viewer and convert to OpenAPI schema
  • Multi-version Support: Select multiple Proxmox versions with latest mapped to official Proxmox API viewer
  • Swagger Docs: FastAPI auto-generates OpenAPI documentation at /docs

Supported Proxmox Versions

Version Status Schema directory
9.1.11 Primary (CI-tested) proxmox_sdk/generated/proxmox/9.1.11/
latest Alias for 9.1.11 (CI-tested) proxmox_sdk/generated/proxmox/latest/

Both schema directories ship the same captured surface and CI exercises them in parallel via PROXMOX_MOCK_SCHEMA_VERSION=[latest, 9.1.11]. Older releases (8.x, 7.x) may still work for endpoints whose shapes have not changed, but they are no longer in the CI matrix — regenerate locally with proxmox-sdk-codegen --version-tag <your-version> if you need them.

Installation

pip install proxmox-sdk

Quick Start

Mock Mode (Default)

# Install
pip install proxmox-sdk

# Start server
uvicorn proxmox_sdk.main:app --reload

# View Swagger docs
# Open http://localhost:8000/docs

SDK Direct Usage (No Server Required)

from proxmox_sdk.sdk import ProxmoxSDK

# Async with mock data
async with ProxmoxSDK.mock() as proxmox:
    nodes = await proxmox.nodes.get()

# Or sync (blocking)
with ProxmoxSDK.sync_mock() as proxmox:
    nodes = proxmox.nodes.get()

CLI TUI

# Install with CLI extras
pip install proxmox-sdk[cli]

# Production TUI
pbx tui

# Mock TUI
pbx tui mock

Real Mode (Connect to Proxmox)

# Configure credentials
export PROXMOX_API_MODE=real
export PROXMOX_URL=https://proxmox.example.com:8006
export PROXMOX_API_TOKEN=PVEAPIToken=user@realm!tokenid=uuid

# Start server
uvicorn proxmox_sdk.main:app --reload

See the Quick Start Guide for more details.

Documentation

Environment Variables

Mock Mode

  • PROXMOX_API_MODE - Set to "mock" (default) or "real"
  • PROXMOX_MOCK_SCHEMA_VERSION - Version tag to use (default: "latest")
  • PROXMOX_MOCK_DATA_PATH - Path to custom mock data file (default: "/etc/proxmox-sdk/mock-data.json")

Real Mode

  • PROXMOX_API_MODE - Set to "real" to enable Proxmox integration
  • PROXMOX_URL - Proxmox server URL (e.g., "https://proxmox.example.com:8006")
  • PROXMOX_API_TOKEN - API token (recommended, format: "PVEAPIToken=user@realm!tokenid=uuid")
  • PROXMOX_USERNAME - Username (fallback, format: "user@realm")
  • PROXMOX_PASSWORD - Password (fallback)
  • PROXMOX_API_VERIFY_SSL - Verify SSL certificates (default: true)

Server

  • HOST - Host to bind to (default: "0.0.0.0")
  • PORT - Port to bind to (default: "8000")

Development

# Install dependencies
uv sync --extra test

# Run tests
pytest

# Run linting
ruff check .
ruff format --check .

# Run type checks
uv run ty check proxmox_sdk tests --output-format concise
uv run pyright proxmox_sdk

IDE Support

Open the repository in VS Code. When prompted, install the recommended extensions (ms-python.vscode-pylance, ms-python.python, charliermarsh.ruff). Pylance picks up types from the installed package automatically because proxmox_sdk ships a py.typed PEP 561 marker.

Type checking uses two gates: ty for fast project checks and pyright for Pylance-compatible diagnostics. Both run at typeCheckingMode = "basic":

uv run ty check proxmox_sdk tests --output-format concise
uv run pyright proxmox_sdk

Docker

All images are Alpine-based (smaller footprint), built from this repository with uv and uv.lock in a multi-stage Dockerfile. Three variants are published to Docker Hub:

Variant Tags Description
Raw (default) latest, <version> Pure uvicorn, HTTP only. Smallest image.
Nginx latest-nginx, <version>-nginx nginx terminates HTTPS via mkcert; proxies to uvicorn.
Granian latest-granian, <version>-granian Granian (Rust ASGI server) with native TLS via mkcert. No nginx.

Upgrade note: before v0.0.2, only runtime+mkcert images existed. From v0.0.2+, latest is the raw uvicorn image. Pull latest-nginx for HTTPS with nginx.

Raw image (default)

Plain uvicorn on HTTP — the simplest option for local dev or when you put your own proxy in front.

docker pull emersonfelipesp/proxmox-sdk:latest
docker run -d -p 8000:8000 --name proxmox-sdk emersonfelipesp/proxmox-sdk:latest

Build from source:

docker build -t proxmox-sdk:raw .
docker run -d -p 8000:8000 proxmox-sdk:raw

Nginx image (nginx + mkcert HTTPS + uvicorn)

nginx terminates HTTPS on PORT (default 8000) using certificates from mkcert and proxies to uvicorn on 127.0.0.1:8001. supervisord manages both processes.

docker pull emersonfelipesp/proxmox-sdk:latest-nginx
docker run -d -p 8443:8000 --name proxmox-sdk-nginx \
  emersonfelipesp/proxmox-sdk:latest-nginx

Build from source:

docker build --target nginx -t proxmox-sdk:nginx .
docker run -d -p 8443:8000 proxmox-sdk:nginx

Granian image (granian + mkcert HTTPS)

Granian is a Rust-based ASGI server with native HTTP/2, WebSocket, and TLS support. This variant eliminates nginx and supervisord — a single granian process handles everything.

docker pull emersonfelipesp/proxmox-sdk:latest-granian
docker run -d -p 8443:8000 --name proxmox-sdk-granian \
  emersonfelipesp/proxmox-sdk:latest-granian

Build from source:

docker build --target granian -t proxmox-sdk:granian .
docker run -d -p 8443:8000 proxmox-sdk:granian

mkcert environment variables (nginx and granian images)

Variable Default Description
PORT 8000 Port the server listens on
MKCERT_CERT_DIR /certs Directory where certs are stored
MKCERT_EXTRA_NAMES Extra SANs (commas or spaces), e.g. proxmox-api.lan,10.0.0.5
CAROOT Mount a volume here to persist the local CA across container restarts
APP_MODULE proxmox_sdk.mock_main:app ASGI app to run (change to proxmox_sdk.main:app for real mode)
docker run -d -p 8443:8000 --name proxmox-sdk-tls \
  -e MKCERT_EXTRA_NAMES='myhost.local,192.168.1.10' \
  -e APP_MODULE='proxmox_sdk.main:app' \
  emersonfelipesp/proxmox-sdk:latest-nginx

To run a shell instead of starting the server, pass a command (the entrypoint delegates to it):

docker run --rm emersonfelipesp/proxmox-sdk:latest-nginx sh

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

proxmox_sdk-0.0.4.post2.tar.gz (794.7 kB view details)

Uploaded Source

Built Distribution

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

proxmox_sdk-0.0.4.post2-py3-none-any.whl (856.6 kB view details)

Uploaded Python 3

File details

Details for the file proxmox_sdk-0.0.4.post2.tar.gz.

File metadata

  • Download URL: proxmox_sdk-0.0.4.post2.tar.gz
  • Upload date:
  • Size: 794.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for proxmox_sdk-0.0.4.post2.tar.gz
Algorithm Hash digest
SHA256 ea96283c1b3c875956483f8abe207bb8b368e0d31f552ef799e54bca5fdf972e
MD5 919a4ab49a8479933ecd9ca932ab939d
BLAKE2b-256 a9b584e9a2da1b8a73dc1a92721f88d282307c19718bf78bba820b1af8ea0486

See more details on using hashes here.

File details

Details for the file proxmox_sdk-0.0.4.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for proxmox_sdk-0.0.4.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 9196d73bdc06b68c96e7c7bb796a24a2b4a2d71f2a06dfc79ffa83ca1cb02b08
MD5 b4b77a3b5cefa568bbd2083005f76f3a
BLAKE2b-256 865980fbc2ea6be88aeb745094938f51bcf82d7d30dffe55e30e3a5f99683264

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