skillfed

pylxd

Python library for interacting with the LXD REST API

pylxd v2.4.1 78.4K downloads/30d#14,447 on PyPI277
Permissive license Apache-2.0 Active released

What it is and what it does

pylxd is a Python client library for the LXD container and virtual machine manager, maintained by Canonical. It wraps the LXD REST API to let you create, configure, start, stop, and manage containers and VMs programmatically from Python code. The library depends on cryptography, requests, requests-toolbelt, python-dateutil, and ws4py for HTTP communication, secure operations, and WebSocket support.

You use it when you need to automate LXD operations—provisioning containers, orchestrating deployments, or integrating LXD into larger Python-based infrastructure tools. It's aimed at system administrators and developers working with LXD on Linux systems who want to avoid shell scripting or direct REST calls.

Use it for:

  • Automate container provisioning and lifecycle management in Python-based infrastructure-as-code tools.
  • Build monitoring or management dashboards that query and control LXD containers programmatically.
  • Integrate LXD container operations into CI/CD pipelines or deployment orchestration scripts.
  • Write administrative tools to batch-manage containers, snapshots, and resource allocation across LXD hosts.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pylxd provides a Python interface to the LXD REST API, enabling programmatic control of LXD containers and virtual machines.

Yes. pylxd is actively maintained, has no known vulnerabilities, installs cleanly with common dependencies, and is the standard Python client for LXD. Install it if you need to automate LXD operations from Python; skip it if you only use LXD from the command line or don't manage LXD systems.

Install

pylxd on PyPI

pip

pip install pylxd

uv

uv add pylxd

poetry

poetry add pylxd

Installing pylxd

Before you install

Low install friction with a pure-wheel distribution and five common runtime dependencies. Active maintenance with a recent release (130 days ago) and ongoing repository activity.

License in practice

Apache-2.0 permissive license allows use in most projects, including commercial ones, with minimal restrictions.

Quickstart

pip install pylxd

import pylxd

# Connect to LXD daemon
client = pylxd.client.Client()

Requires Python 3.10 or later; LXD daemon must be running and accessible on the system.

Verify before relying

  • Whether the package works with remote LXD instances or only local sockets.
  • Performance characteristics when managing large numbers of containers.
  • Compatibility with different LXD versions and API stability guarantees.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — cryptography, python-dateutil, requests, requests-toolbelt, ws4py
Maintenance actively maintained — 130 days since the last release
Last repo commit
First released
Downloads 78,366/month — #14,447 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pylxd-2.4.1-py3-none-any.whl

Intended Audience :: Information TechnologyIntended Audience :: System AdministratorsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3

Tags

lxd python clientlxd rest api librarycontainer management pythonlxd automationpython lxd control
container-managementlxd-clientinfrastructure-automation

More Distributed Computing packages