libusb1
Pure-python wrapper for libusb-1.0
What it is and what it does
libusb1 is a pure-Python ctypes-based wrapper around the libusb-1.0 C library, exposing USB device enumeration, configuration, and data transfer operations as Python classes and methods. It maps libusb functions to object-oriented interfaces—for example, libusb_init becomes USBContext, and libusb_get_device_list becomes a context method returning USBDevice instances—while converting C error codes into Python exceptions.
The package supports both synchronous blocking I/O and asynchronous event-driven transfers with callbacks, allowing developers to build USB applications on GNU/Linux, Windows, OSX, FreeBSD, and OpenBSD without writing C code. It handles the complexity of device claiming, interface selection, and transfer lifecycle management, though users must still install the appropriate system libusb library and, on Windows, configure device drivers separately.
Use it for:
- Read sensor data or control hardware devices connected via USB in embedded or IoT applications.
- Build cross-platform USB diagnostic or firmware-flashing tools without rewriting logic per OS.
- Implement high-throughput data acquisition from USB instruments using asynchronous transfer batching.
- Enumerate and interact with multiple USB devices in a single Python process for device management utilities.
- Prototype USB communication logic in Python before optimizing performance-critical paths in C.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python wrapper for libusb-1.0 that enables synchronous and asynchronous USB device communication across multiple operating systems.
Yes, if you need USB device access from Python and can install libusb-1.0 on your target OS. The package is actively maintained, has no known vulnerabilities, installs with low friction, and provides a clean Python API to libusb. The LGPL-2.1-or-later license is permissive for most use cases but requires disclosure if you distribute the library; check your project's licensing constraints. Windows users must handle driver setup separately.
Install
libusb1 on PyPI
pip
pip install libusb1uv
uv add libusb1poetry
poetry add libusb1Installing libusb1
Before you install
Low friction installation; pure Python wheel with no compiled dependencies. Active maintenance with last commit on 2026-05-16 and release within 90 days. No known vulnerabilities.
License in practice
Licensed under LGPL-2.1-or-later (copyleft). Derivative works and modifications must be distributed under compatible terms; proprietary applications can link to it but must disclose the library and allow relinking.
Quickstart
pip install libusb1
import libusb1
with libusb1.USBContext() as context:
handle = context.openByVendorIDAndProductID(VENDOR_ID, PRODUCT_ID)
if handle:
data = handle.bulkRead(ENDPOINT, BUFFER_SIZE)
Requires libusb-1.0 system library installed and accessible to ctypes; on Windows, driver setup (WinUSB or libusbk) needed per device; CPython 3.6+ or PyPy 2.0+ required.
Verify before relying
- Whether the package maintains backward compatibility across major versions beyond what the changelog indicates.
- Current test coverage and CI/CD pipeline maturity for the listed supported OSes.
- Performance characteristics for high-throughput or low-latency transfer scenarios.
Package facts
| License | LGPL-2.1-or-later (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 90 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 618,950/month — #5,731 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: libusb1-3.4.0-py3-none-any.whl
Keywords: usb, libusb
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
libusb-packageBundles libusb shared libraries for multiple…
permissive · top 5,000 on PyPI
pyusbPyUSB provides Python access to USB devices on…
permissive · top 5,000 on PyPI
hidapiProvides a Python interface to HIDAPI, enabling…
unclear · top 5,000 on PyPI
libusbsioProvides a Python wrapper around NXP's…
permissive · top 15,000 on PyPI
pylibftdiPythonic interface to FTDI USB devices via…
permissive · top 15,000 on PyPI
pyftdiPyFtdi provides a pure-Python user-space driver…
permissive · top 15,000 on PyPI
hidProvides Python bindings to the hidapi library…
permissive · top 15,000 on PyPI
binho-host-adapterControls Binho Multi-Protocol USB Host Adapters…
permissive · top 15,000 on PyPI
brainstemProvides Python bindings to control and…
unclear · top 15,000 on PyPI
ft4222Provides Python bindings to LibFT4222, enabling…
permissive · top 15,000 on PyPI