python-usb
List all USB devices in a developer-friendly tree view. Zero dependencies — works on macOS, Linux, and Windows.
Dev
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
python-usb
Install
pip install python-usb
Usage
python-usb
Example output (macOS):
└── USB 3.1 Bus
├── USB Keyboard [05ac:024f]
│ Vendor: Apple Inc.
│ Serial: ABCD1234
│ Speed: Full Speed
│ Power: 50 mA
├── USB Mouse [046d:c077]
│ Vendor: Logitech
│ Speed: Low Speed
└── USB Hub [2109:2817]
Vendor: VIA Labs, Inc.
Speed: Super Speed
└── External SSD [0781:5583]
Vendor: SanDisk
Serial: 12345678
Speed: Super Speed
Power: 896 mA
JSON output
python-usb --json
What it shows
| Field | Description |
|---|---|
| Name | Product / device name |
| ID | vendor_id:product_id (hex) |
| Vendor | Manufacturer name |
| Serial | Serial number |
| Speed | Low / Full / High / Super Speed |
| Class | USB device class |
| Driver | Kernel driver in use |
| Location | Bus and device number |
| Power | Max power draw |
| USB Ver | USB specification version |
How it works
| Platform | Method |
|---|---|
| macOS | system_profiler SPUSBDataType -json |
| Linux | /sys/bus/usb/devices sysfs (or lsusb) |
| Windows | PowerShell + WMI Win32_PnPEntity |
No compiled extensions, no libusb dependency.
Publish to PyPI
- Update the version in
pyproject.toml. - Create a PyPI API token at https://pypi.org/manage/account/token/.
- Install the publishing tools:
python -m pip install --upgrade build twine
- Build the distribution files:
python -m build
python -m twine check dist/*
- Upload to PyPI:
python -m twine upload dist/*
Use __token__ as the username and your PyPI API token as the password when prompted.
License
MIT
Metadata
Release files for python-usb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_usb-0.1.0.tar.gz | 10.7 kB | Without provenance | Details for python_usb-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_usb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for python_usb-0.1.0-py3-none-any.whl |
Total release size: 21.6 kB
Release files / python_usb-0.1.0.tar.gz
| Download URL | python_usb-0.1.0.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7823525d236db875a6dbfbf38092e792ac787273de5f765529226d929ad27eb9
|
|
BLAKE2b-256 checksum How to use checksums |
1a6bec80c3cde6e81dc8fcb296ccc6fbc8a200559def543a8e2b350aeffa86f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / python_usb-0.1.0-py3-none-any.whl
| Download URL | python_usb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
683b798d39e71c56f51d4434c9fff8e5537808278e9c41a522cefa287f699374
|
|
BLAKE2b-256 checksum How to use checksums |
74f06627d4bc9d13da3c004c45a22d7ea16f7fa32af401b802d71778c23914a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for python-usb 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.