Skip to content

Repository files navigation

pyudev-zero

A pure Python implementation of libudev-zero

Usages

List all devices

importjsonfordevinudev_enumerate_scan_devices():
print(f'Device {dev}: {json.dumps(dev.properties, indent=4)}')

List all USB tty devices

importjsonfordevinudev_enumerate_scan_devices(lambdad: d.subsystem=='tty'):
parent=dev.get_parent_filter(lambdad: d.subsystem=='usb')
ifparent:
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.

About

A pure Python implementation of libudev-zero

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages