Skip to main content

A cross-platform tool to monitor and inspect USB devices connected to the host system.

Project description

USB Inspector

Coverage

Overview

A simple package that leverages pyusb and allows you to lookup USB vendor and device IDs and get back a human readable vendor and device name. It includes ability to manually update the USB DB without installing a new version of usb-inspector.

Installation

uv add usb-inspector
# via pip
python3 -m pip install usb-inspector

IMPORTANT: On Windows ensure you have libusb-1.0.dll (64bit) in C:\Windows\System32 or you will get a NoBackendError. You can get it from here.

Raspberry Pi

  • Raspberry Pi 3B+ trixie aarch64 64bit

Example Usage

Command Line:

usb-inspector lookup --vendor-id 1A40
usb-inspector lookup --vendor-id 1A40 --device-id 0801

# To manually update the USB DB
usb-inspector delete-data
usb-inspector update-db
from usb_inspector.monitor import USBDeviceMonitor

usb_monitor = USBDeviceMonitor(poll_interval=1.0)
usb_monitor.monitor()
# Do stuff
...
usb_monitor.stop()

Issues

If you experience any issues, please create an issue on Bitbucket.

Development

To get a list of all commands with descriptions simply run make.

make env
make pip_install_editable

Testing

make pytest
make coverage
make open_coverage

History

All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

0.2.1 (2025-11-21)

  • ADDED port to the device info
  • CHANGED cleaned up logging on connect/disconnect descriptions

0.2.0 (2025-11-21)

  • FIXED Connecting/Disconnecting the same physical device to the same port now correctly identifies the device as the same device on Windows/Linux.

0.1.9 (2025-11-21)

  • FIXED Cached sql db lookup so it occurs only once.

0.1.8 (2025-11-20)

  • FIXED turned default packaged logging to ERROR. Was INFO...Sorry!

0.1.7 (2025-11-13)

  • FIXED is_connected bug introduced in last patch.
  • ADDED improved tracking of devices allowing multiple of the same vendor/device ID to be connected.

0.1.6 (2025-11-13)

  • FIXED last_seen timestamp for each device, only updates when connected/disonnected.

0.1.5 (2025-11-05)

  • Locked pandas to version 2.3.3 for Raspberry Pi compatability (it pulls the pre-built wheel from piwheels.org)

0.1.4 (2025-11-05)

  • Added last_seen timestamp for each device.

0.1.4 (2025-10-31)

  • update-db cli command only adds new Vendors and Devices to the existing DB rather than requiring deletion and recreation of the DB.
  • Track which devices are connected/disconnected.

0.1.2 (2025-10-30)

  • Fix lookup error

0.1.1 (2025-10-30)

  • Added start as an alias for monitor.

0.1.0 (2025-10-30)

  • First release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

usb_inspector-0.2.1.tar.gz (271.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usb_inspector-0.2.1-py3-none-any.whl (269.6 kB view details)

Uploaded Python 3

File details

Details for the file usb_inspector-0.2.1.tar.gz.

File metadata

  • Download URL: usb_inspector-0.2.1.tar.gz
  • Upload date:
  • Size: 271.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for usb_inspector-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b0f21524b7a3cbd5aa546cf9de8d4e2041f4dd3d2c33e890d7b9ef8f42d1d233
MD5 12fa4f046daa6a9108c68bd6e12b371f
BLAKE2b-256 28fd23c1c79490b1060d93d6d4e007d525c0e8726733514d3a7a077ebec4f16d

See more details on using hashes here.

File details

Details for the file usb_inspector-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: usb_inspector-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 269.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for usb_inspector-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3ac611252345e1555d061793d41212fdc0bc4b8c2de1e78861c0cdf01eb4d66
MD5 056da626b0da949b7419210e6b237a25
BLAKE2b-256 f435764d1caf8fb3b891c612d0a6a7db1ec6b0a8e6ac65c07bcd14fbb552a0cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page