pyudev
A libudev binding
Decision gist · record as of 2026-08-14
Yes. pyudev is stable (Production/Stable status), actively maintained, has no security vulnerabilities, and solves a real problem for Linux system tools. The LGPL copyleft license is standard for system libraries and poses no barrier to most use. Install it if you need programmatic access to udev from Python on Linux; it is the standard binding for this task.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Linux with libudev installed; does not work on Windows or macOS.
- Requires Python 3.9 or newer.
- Low friction install with no runtime dependencies.
License · maintenance · safety
LGPL 2.1+ (copyleft) — Licensed under LGPL 2.1+, a copyleft license. Derivative works and modifications must be released under compatible terms; proprietary applications can use it as a library but must disclose the license.
last release 2025-10-08 (310 days) · last repo commit 2026-07-31 · 175 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,475,835 downloads/mo, #3,861 on PyPI
Alternatives
Verify before relying
import pyudev
context = pyudev.Context()
for device in context.list_devices(subsystem='block', DEVTYPE='partition'):
print(device.get('ID_FS_LABEL', 'unlabeled partition'))- Whether libudev must be pre-installed on the system or is bundled/installed as part of pyudev setup.
- Exact minimum udev version required; description mentions 151 or newer are tested but earlier versions may work.
What it is and what it does
pyudev wraps the libudev library to give Python code direct access to Linux device and hardware information. It lets you list all devices on the system, filter by subsystem or properties, read device attributes, and monitor for device changes in real time. The binding is pure Python and supports both CPython 3 and PyPy, making it portable across Python implementations on Linux systems.
Typical use cases include system utilities that need to detect when USB devices are plugged in, applications that enumerate block devices or network interfaces, and tools that monitor hardware state. The library handles both synchronous queries and asynchronous monitoring via threads or event loops (Qt, Glib, wxPython).
Use it for
- Detect and react to USB device hotplug events in a system utility or daemon.
- Enumerate all block devices and partitions to build a device list for a storage management tool.
- Query device properties and attributes (labels, UUIDs, device types) without shelling out to udevadm.
- Monitor hardware changes asynchronously within a Qt or Glib event loop in a desktop application.
- Build a hardware inventory tool that reads device capabilities and identifiers from the kernel.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pyudev is stable (Production/Stable status), actively maintained, has no security vulnerabilities, and solves a real problem for Linux system tools. The LGPL copyleft license is standard for system libraries and poses no barrier to most use. Install it if you need programmatic access to udev from Python on Linux; it is the standard binding for this task.
Install
pyudev on PyPI
Before you install
Low friction install with no runtime dependencies. Actively maintained with regular releases; last commit 2026-07-31. Requires Python 3.9 or newer and a Linux system with libudev present.
Requires Linux with libudev installed; does not work on Windows or macOS. Requires Python 3.9 or newer.
License in practice
Licensed under LGPL 2.1+, a copyleft license. Derivative works and modifications must be released under compatible terms; proprietary applications can use it as a library but must disclose the license.
Quickstart
import pyudev
context = pyudev.Context()
for device in context.list_devices(subsystem='block', DEVTYPE='partition'):
print(device.get('ID_FS_LABEL', 'unlabeled partition'))
Verify before relying
- Whether libudev must be pre-installed on the system or is bundled/installed as part of pyudev setup.
- Exact minimum udev version required; description mentions 151 or newer are tested but earlier versions may work.
Package facts
| License | LGPL 2.1+ copyleft |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 310 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,475,835 / month, #3,861 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: LibrariesTopic :: System :: HardwareTopic :: System :: Operating System Kernels :: Linux |
Evidence: pyudev-0.24.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “linux device enumeration python”
- pyudevpyudev is a pure Python binding for libudev that lets you enumerate,…
- PyRICPyRIC provides programmatic control over Linux wireless interfaces,…
- libpciProvides Python bindings to libpci, allowing you to query PCI device…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also evdev · spidev · pyocd · winrt-Windows.Devices.Enumeration · ft4222 · hidapi · libusb-package · jeepney · pyjoulescope-driver · libpci