pyudev is a Python binding to libudev, the hardware management library and service found in modern linux systems. It is available under the same licence as the original library, which is the GNU LGPL 2.1 (see Licencing for details).
The current release is pyudev 0.14, available in the Python Package Index. Refer to the Changelog for a list of important changes since the last release [1].
The basic binding is implemented in pure Python atop of ctypes. The only dependencies are udev and Python. pyudev supports CPython 2.6 or newer (including 3.x) and PyPy 1.5 or newer, and is tested against udev 151 and newer. Older versions of older versions of udev may or may not work. If pyudev doesn’t work with your udev version, please report an issue (see Contribution and Development).
The toolkit integration modules in pyudev.pyqt4, pyudev.pyside, pyudev.glib and pyudev.wx require some libraries from the corresponding toolkit. Refer to the documentation of these modules for a more precise description.
Installation is rather simple, just run:
pip install pyudev
Usage of pyudev is rather simple:
>>> from pyudev import Context
>>> context = Context()
>>> for device in context.list_devices(subsystem='input', ID_INPUT_MOUSE=True):
... if device.sys_name.startswith('event'):
... device.parent['NAME']
...
u'"Logitech USB-PS/2 Optical Mouse"'
u'"Broadcom Corp"'
u'"PS/2 Mouse"'
Please read the API documentation for detailed information.
There is a mailing list at pyudev@librelist.com (hosted by librelist.com) for user questions and development discussion around pyudev. To subscribe to this list, just send a mail to pyudev@librelist.com and reply to the configuration mail. The original mail is ditched.
To unsubscribe, send a mail to pyudev-unsubscribe@librelist.com and reply to the configuration email.
Older discussions are available in the list archives.
Please report issues and feature requests to the issue tracker [2]. Development discussions are located on the mailing list (see above).
Development itself happens on GitHub. The complete source code is available in a git repository:
git clone --recursive git://github.com/lunaryorn/pyudev.git
Feel free to fork the repository. Pull requests and patches are welcome! If you indent to contribute to pyudev, you may want to read the testsuite documentation to learn how to write unit tests for your code.
Footnotes
[1] | A detailed list of changesets is also available. |
[2] | Please assign proper labels to the issue and provide detailed information about the issue. If possible, include copied and pasted output from the programs, or a code example demonstrating the issue. |