--- id: pyudev version: "0.24.4" license: LGPL 2.1+ license_treatment: copyleft maintenance: active --- # pyudev — A libudev binding License: copyleft · Maintenance: active · Downloads: 1.5M/mo ## 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 above — verify before relying. pyudev is a pure Python binding for libudev that lets you enumerate, query, and monitor Linux devices and hardware from Python code. 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 pip install pyudev uv add pyudev poetry add pyudev ## Installing pyudev 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. 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')) Requires Linux with libudev installed; does not work on Windows or macOS. Requires Python 3.9 or newer. 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_current - Install friction: low - Maintenance: active - Downloads: 1.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags linux device enumeration python, udev binding python, hardware monitoring linux, device properties query, libudev python wrapper, linux-hardware, device-management, system-integration [View on SkillFed](https://skillfed.io/packages/pyudev) · [View on PyPI](https://pypi.org/project/pyudev/)