Skip to content
A Python library to interact with USB devices.
Python
Branch: master
Clone or download
Latest commit 99f48cc Sep 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
usb_manager Added travis support Aug 26, 2018
.gitignore Initial commit Feb 3, 2018
.travis.yml Update Pypi password Sep 23, 2018
LICENSE Create LICENSE Feb 5, 2018
MANIFEST.in Initial commit Feb 3, 2018
README.md Add coveralls badge Sep 23, 2018
requirements.txt Added travis support Aug 26, 2018
setup.cfg Added usb_manager to pip Feb 5, 2018
setup.py Update Pypi password Sep 23, 2018

README.md

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

You can’t perform that action at this time.