Skip to main content

pyudev

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

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'))
...
boot
swap
system

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

Support

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.

Development

The source code is hosted on GitHub:

git clone git://github.com/pyudev/pyudev.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.

Metadata

Release files for pyudev 0.24.5

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

Source distribution (sdist)

Source distribution for pyudev 0.24.5
File Size Uploaded
pyudev-0.24.5.tar.gz 55.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyudev 0.24.5
File Interpreter ABI Platform
pyudev-0.24.5-py3-none-any.whl Python 3 none any Details

Total release size: 115.8 kB

Release files / pyudev-0.24.5.tar.gz

Download URL pyudev-0.24.5.tar.gz
Size 55.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4e7faaec419b81a902d057568101819f448972c0cf448bb9c22203e4fc6a8eb9
BLAKE2b-256 checksum
How to use checksums
6a45770eda636216c62be4a06af01c7235923ca0580d72fd3e3178fb01b3ae01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release files / pyudev-0.24.5-py3-none-any.whl

Download URL pyudev-0.24.5-py3-none-any.whl
Size 60.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9c62d04a83472fb05ad5e014ef85933e5cf2fef193caf8b77bb7a9e8ded4812
BLAKE2b-256 checksum
How to use checksums
5f560baea14a1c772ce3df2c5d3a57802b31bcdee555f11dc8d18d23a927d14f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7
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