Skip to main content

Libvirt Python Binding README

This package provides a module that permits applications written in the Python 3.x programming language to call the interface supplied by the libvirt library, to manage the virtualization capabilities of recent versions of Linux (and other OSes). As such, the module exposes Python bindings to to the libvirt.so, libvirt-qemu.so and libvirt-lxc.so library APIs.

It is written to build against any version of libvirt that is 0.9.11 or newer.

This code is distributed under the terms of the LGPL version 2 or later.

Requirements

To build the libvirt python binary requires the GCC and pkg-config tools, and development headers for the libvirt and python libraries.

Additionally, the Python build module is required and can be installed via:

$ dnf install python3-build

or

$ python3 -m pip install –user build

Building and installing

The module can be built by following the normal python module build process

$ python3 -m build

for testing and distributing purposes or it can be installed directly via pip as

$ python3 -m pip install .

without explicit building.

In order to test the package, you’ll need either tox or at least pytest, depending on whether you want to test an already installed package in which case the latter is sufficient or if you wish to test in a virtual environment you’d need tox.

To install pytest, use one of:

$ dnf install python3-pytest

or

$ python3 -m pip install –user pytest

To install tox, use one of:

$ dnf install python3-tox

or

$ python3 -m pip install –user tox

Additionally, install the remaining test dependencies:

$ python3 -m pip install -r requirements-test.txt

Depending on your preferred setup, you can run the tests either as

$ python3 -m pytest

or as

$ tox

Free-threaded Python (py313t, py314t) test environments require tox>=4.26 and the corresponding free-threaded interpreters (python3.13t, python3.14t) to be installed.

A makefile shim is also provided for your convenience, so that you don’t have to care about the exact operations mentioned above and instead you simply do

$ make && make check

As of libvirt 1.2.6, it is possible to develop against an uninstalled libvirt.git checkout, by setting PKG_CONFIG_PATH and LD_LIBRARY_PATH environment variables to point into that libvirt tree; you can even automate this by using libvirt’s run script:

/path/to/libvirt/run python3 -m build

Patches for this code should be submitted as merge requests to the project page on gitlab. See CONTRIBUTING.rst for more information.

Metadata

Release files for libvirt-python 12.8.0

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

Source distribution (sdist)

Source distribution for libvirt-python 12.8.0
File Size Uploaded Provenance
libvirt_python-12.8.0.tar.gz 256.6 kB Without provenance Details

Release files / libvirt_python-12.8.0.tar.gz

Download URL libvirt_python-12.8.0.tar.gz
Size 256.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ab24a102ebf99b913ddc3459031aa71a48b0b1cdbb0f423b4ea278052791ac8a
BLAKE2b-256 checksum
How to use checksums
6c9e7211301d1d53acfaa5f99bec4af279e575c31e0aca7e2fe84a5aaa73d8f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Security for libvirt-python 12.8.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

12.8.0 This release

1 release file No provenance

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