Skip to main content

Modern and user-friendly library for working with USB devices

Project description

usbx

usbx is a modern, powerful and user-friendly Python library for working with USB devices. It provides many useful features:

  • Querying information about connected devices
  • Communication with USB devices
  • Notification when devices are connected and disconnected
  • Single API for Windows, Linux and macOS
  • Good documentation
  • Thread-safe
  • No need to install further software like libusb

usbx is easy to use:

>>> from usbx import usb
>>> for device in usb.get_devices():
...     print(device)
...
USD device 4295171929, vid=0x1a40, pid=0x0801, manufacturer=None, product=USB 2.0 Hub, serial=None
USD device 4295171974, vid=0x0b0e, pid=0x0412, manufacturer=None, product=Jabra SPEAK 410 USB, serial=783F92B9DD3Cx011200

Installing

usbx can be installed with pip:

python -m pip install usbx

Usage

The User Guide will get you started with the library. Also read Platform-specific Considerations as some operating systems might need extra steps to work with USB devices.

The API Reference documentation provides API-level documentation.

Examples

Serveral examples demonstrate the use of the library:

  • enumerate.py: Enumerate all connected devices including details about the interfaces and endpoints
  • monitor.py: Monitor USB devices being connected and disconnected
  • epaper.py: Display an image on e-paper display with (with IT8951 controller)
  • stm32dfu: Upload firmware to an STM32 based device

License

usbx is made available under the MIT License. For more details, see The MIT License.

Contributing

This is an open-source project that happily accepts contributions. Please see Contributing for details.

System Requirements

  • Python 3.9 or higher
  • Windows (x86-64 or ARM), Linux (x86-64 or ARM), macOS (x86-64 or ARM)
  • 64-bit platform and Python interpreter
  • For Linux: udev (usually goes together with systemd)

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

usbx-0.8.2.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

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

usbx-0.8.2-py3-none-any.whl (57.4 kB view details)

Uploaded Python 3

File details

Details for the file usbx-0.8.2.tar.gz.

File metadata

  • Download URL: usbx-0.8.2.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for usbx-0.8.2.tar.gz
Algorithm Hash digest
SHA256 4f0f2703fdae9bc894842b825805552945fc29e069fde129e47e7e3ebedc3b4f
MD5 171933e33e66d6bca05ffb79fdbc9634
BLAKE2b-256 67e35f2a0e69746294e141b22a75fc69c2aaefd9bd16e6acf702f107549bbf12

See more details on using hashes here.

File details

Details for the file usbx-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: usbx-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 57.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for usbx-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9fca1c347dd41661f1a382d83c7b04646678bd035123ea7c67ac6abafa993492
MD5 842c29acb6bc5a048e300539a789fca4
BLAKE2b-256 3b6ac307b2aadd5db889f9a653ba1f31bef3e2cc2fe1d4b3d94538d281f247ab

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