A libudev binding
Project description
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:
Read how to properly contribute to open source projects on GitHub.
Understand the branching model.
Use a topic branch based on the develop branch to easily amend a pull request later, if necessary.
Write good commit messages.
Squash commits on the topic branch before opening a pull request.
Respect PEP 8 (use pep8 to check your coding style compliance).
Add unit tests if possible (refer to the testsuite documentation).
Add API documentation in docstrings.
Open a pull request that relates to but one subject with a clear title and description in grammatically correct, complete sentences.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyudev-0.23.0.dev20220122.tar.gz
.
File metadata
- Download URL: pyudev-0.23.0.dev20220122.tar.gz
- Upload date:
- Size: 87.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c728166f31dfc317dc3d5b32374871b50ccb661437aba12ab3fc508c77e916ce |
|
MD5 | 535dc0d5650709643038b2b2fa686fa7 |
|
BLAKE2b-256 | b4477e1b9cc70f44ff60bab388cc6b9c0adb76a23276bff6292f5470ba9e27ea |
File details
Details for the file pyudev-0.23.0.dev20220122-py3-none-any.whl
.
File metadata
- Download URL: pyudev-0.23.0.dev20220122-py3-none-any.whl
- Upload date:
- Size: 64.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50c87a8b90be7bc2888ee2d8a5bb7acfa78e18063ed46adadb590da8ce6d8a71 |
|
MD5 | c2d550ffccf46ba27d1d4cb65b8b2267 |
|
BLAKE2b-256 | 32a6899794f36109a21adf7a28fbc4ccb258399db0d8b68f03fdc0690031816f |