Not Logged In

pyudev 0.21.0

pyudev is a LGPL licensed, pure Python binding for libudev, the device and
hardware management and information library for Linux. It supports almost all
libudev functionality. You can enumerate devices, query device properties and
attributes or monitor devices, including asynchronous monitoring with threads,
or within the event loops of Qt, Glib or wxPython.

The binding supports CPython 2 (2.6 or newer) and 3 (3.1 or newer), and PyPy
1.5 or newer. It is tested against udev 151 or newer, earlier versions of udev
as found on dated Linux systems may work, but are not officially supported.

Usage

Usage of pyudev is quite simply thanks to the power of the underlying udev
library. Getting the labels of all partitions just takes a few lines: