Python bindings to libudev (with support for PyQt4, PySide, pygobject and wx)
Python Makefile
Latest commit b4d6d77 Dec 12, 2016 @mulkieran mulkieran committed on GitHub Merge pull request #223 from thijstriemstra/patch-1
Add reference to pyqt5 support
Permalink
Failed to load latest commit information.
doc Add reference to pyqt5 support Dec 12, 2016
src/pyudev
tests Revise device tests to use improved framework. Aug 5, 2016
.gitattributes Configure git Jul 25, 2012
.gitignore
.travis.yml Now build for version 0.22. Jul 21, 2016
CHANGES.rst New version: 0.21 Jul 21, 2016
COPYING Added copy of license May 2, 2010
MANIFEST.in Remove mention of reproducers in MANIFEST and Makefile. Jul 22, 2016
Makefile Remove mention of reproducers in MANIFEST and Makefile. Jul 22, 2016
README.rst Update source link for pyudev group. Apr 29, 2016
requirements.txt Remove dependency on issue tracker. Nov 30, 2015
setup.cfg Exclude distutils build directory from test discovery Sep 1, 2011
setup.py Add dependency on six package. Feb 2, 2016
tox.ini Remove dependency on pyjournalctl. Jul 20, 2016

README.rst

pyudev

https://secure.travis-ci.org/pyudev/pyudev.png?branch=develop

http://pyudev.readthedocs.org

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:

>>> 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: