--- id: libvirt-python version: "12.6.0" license: LGPL-v2.0-or-later license_treatment: copyleft maintenance: active --- # libvirt-python — The libvirt virtualization API python binding License: copyleft · Maintenance: active · Downloads: 323.6K/mo ## What it is and what it does libvirt-python is a Python module that wraps the libvirt C library, exposing its virtualization management API to Python applications. It allows you to programmatically control virtual machines, containers, and other virtualization resources managed by libvirt on Linux and other operating systems. The bindings cover the main libvirt API as well as QEMU and LXC-specific extensions. The package requires a working libvirt installation and development headers on your system, plus standard build tools (GCC, pkg-config) to compile. It supports Python 3.6 and later, is actively maintained, and carries no known security vulnerabilities. The LGPL-v2.0-or-later license permits commercial use but requires source disclosure for modifications. Use it for: - Automate VM lifecycle management (create, start, stop, destroy) on KVM/QEMU hypervisors from Python scripts - Monitor and query running virtual machines and containers (LXC) to retrieve resource usage and status - Build cloud orchestration or infrastructure-as-code tools that need to control libvirt-managed virtualization - Integrate VM provisioning into Python-based deployment or testing frameworks ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python bindings to the libvirt virtualization API, allowing Python applications to manage virtual machines and containers on Linux and other operating systems. Yes, if you need to manage libvirt-controlled VMs or containers from Python and your system already has libvirt installed. The high install friction (compiled dependency) is a real barrier—verify that your platform has prebuilt wheels or that you can satisfy the build requirements before attempting installation. For systems without libvirt or build tools, the installation will fail. ## Install pip install libvirt-python uv add libvirt-python poetry add libvirt-python ## Installing libvirt-python Before you install: High install friction: requires GCC, pkg-config, and libvirt development headers to compile from source. The package is actively maintained (released 11 days ago) and classified as Production/Stable, but the compiled dependency barrier means installation success depends on your system's build toolchain and libvirt libraries being present. License in practice: Licensed under LGPL-v2.0-or-later (copyleft). You may use and modify this package freely, but any derivative work must also be distributed under LGPL or a compatible license, and source code must be made available to recipients. Quickstart: # Install (requires libvirt dev headers and build tools) pip install libvirt-python # Basic usage import libvirt conn = libvirt.open('qemu:///system') doms = conn.listAllDomains() conn.close() Requires GCC, pkg-config, and libvirt development headers (libvirt-devel or libvirt-dev) installed on your system before pip install will succeed. Verify before relying: - Whether prebuilt wheels are available for common platforms to avoid compilation - Specific libvirt version compatibility beyond the stated minimum of 0.9.11 - Performance characteristics or scalability limits for large-scale VM management ## Package facts - License: LGPL-v2.0-or-later (copyleft) - Python support: supports_current - Install friction: high - Maintenance: active - Downloads: 323.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags libvirt python bindings, virtualization management python, kvm qemu lxc python api, virtual machine control python, libvirt api wrapper, python vm management, hypervisor control python, virtualization, system-administration [View on SkillFed](https://skillfed.io/packages/libvirt-python) · [View on PyPI](https://pypi.org/project/libvirt-python/)