A pure Python implementation of libudev-zero
Project description
pyudev-zero
A pure Python implementation of libudev-zero
Usages
List all devices
import json
for dev in udev_enumerate_scan_devices():
print(f'Device {dev}: {json.dumps(dev.properties, indent=4)}')
List all USB tty devices
import json
for dev in udev_enumerate_scan_devices(lambda d: d.subsystem == 'tty'):
parent = dev.get_parent_filter(lambda d: d.subsystem == 'usb')
if parent:
print(f'Device {dev}: {json.dumps(dev.properties, indent=4)}')
print(f'Parent {parent}: {json.dumps(parent.properties, indent=4)}')
Not support
Udev netlink monitoring is currently not supported.
Thanks
This library is rewritten from libudev-zero.
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
pyudev_zero-0.1.0.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyudev_zero-0.1.0.tar.gz.
File metadata
- Download URL: pyudev_zero-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbf4aa5a0822778fecda0cb244c2f2acd694809909e26bfb751adcde8d739348
|
|
| MD5 |
ce3bd79f709ecb448715b849dae9fda8
|
|
| BLAKE2b-256 |
ca7c9a576527d6490f0f809e966c00898fa6b23847495d02e9d97c133bbca1e6
|
File details
Details for the file pyudev_zero-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyudev_zero-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95520edf5e22794914a1759f9ab497912eacfda3dc87b73975a39136014c833c
|
|
| MD5 |
802932a66bc4e486e51cdcc200ca712a
|
|
| BLAKE2b-256 |
f70ded8d37d8866b3142f54b93bcc72e03971faad8849515374aaa0498522cee
|