Skip to content

M-Gregoire/usb_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usb_manager Build Status Coverage Status

A Python library to interact with USB devices.

Installation

usb_manager is available on pip. You can install it using :

pip install usb-manager

Example code

from usb_manager import UsbManager

# Show all usb devices with a vendor id of 1659
UsbManager().filterBy(vid="1659").show()

# Print the serial number of every devices with vendor id of 1659 and pid of 8963
print(UsbManager().filterBy(vid="1659", pid="8963").get("device"))

Filters and getters

Filter/Getter Description
name Short device name, e.g. ttyUSB0.
device Full device name/path, e.g. /dev/ttyUSB0. This is also the information returned as first element when accessed by index.
hwid Technical description or n/a. This is also the information returned as third element when accessed by index.
vid USB Vendor ID (0...65535).
pid USB product ID (0...65535).
serial_number USB serial number
location USB device location string (“-[-]...”)
manufacturer USB manufacturer string, as reported by device.
product USB product string, as reported by device.

NB: Every filter should be passed as a string. Every getter returns a string.

Credits

This (nano-)library is just an easy to use alias exclusivly based on pyserial.

Donation

This project helped you ? You can buy me a cup of coffee
Donate

About

A Python library to interact with USB devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages