Skip to main content

A libudev binding

Project description

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 3 and compatible versions of PyPy. 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 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:

>>> import pyudev
>>> context = pyudev.Context()
>>> for device in context.list_devices(subsystem='block', DEVTYPE='partition'):
...     print(device.get('ID_FS_LABEL', 'unlabeled partition'))

The website provides a detailed user guide and a complete API reference.


Please report issues and questions to the issue tracker, but respect the following guidelines:

  • Check that the issue has not already been reported.

  • Check that the issue is not already fixed in the master branch.

  • Open issues with clear title and a detailed description in grammatically correct, complete sentences.

  • Include the Python version and the udev version (see udevadm --version) in the description of your issue.


The source code is hosted on GitHub:

git clone git://

Please fork the repository and send pull requests with your fixes or new features, but respect the following guidelines:

Request a New Release

I will be doing regular releases of this project every August and October, shortly after Fedora releases are branched from rawhide.

If you believe an extra release would help you in some way, please file an issue, explaining why you need the new release, and I expect I’ll put one up.

Why should you explain why you need the new release? Well, it is helpful to me, because pyudev is not at all part of my regular work, and I tend not to know very much about how it is used these days.

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

pyudev-0.24.1.tar.gz (86.0 kB view hashes)

Uploaded Source

Built Distribution

pyudev-0.24.1-py3-none-any.whl (62.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page