Registry / http-networking / libusbsio

libusbsio

JSON →
library2.2.0pypypi✓ verified 85d ago

libusbsio is a Python wrapper for the NXP LIBUSBSIO C library, designed to facilitate interaction with NXP's USB-to-I2C/SPI/GPIO bridge devices. It provides a high-level API for enumerating, opening, and communicating with supported hardware from Python applications. The current version is 2.2.0, with updates typically tied to enhancements or bug fixes in the underlying C library or the Python binding itself.

pip install libusbsio
INSTALL
IMPORT
SIG · LIBUSBSIO
L
libusbsio
http-networkingpythonv2.2.0
Install
1.6s avg
Import
47ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.043s · 18.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.050s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

libusbsio
import libusbsio
All core classes and functions (e.g., SiODevice, SiOBus, SiOError) are typically accessed as attributes of the libusbsio module.
SiODevice
from libusbsio import SiODevice
import SiODevice
Classes like SiODevice are part of the libusbsio module; they cannot be imported directly without specifying the parent module.

This quickstart demonstrates how to enumerate available NXP SiO devices and open the first one found. It uses a context manager (`with ... as`) to ensure the device is properly closed after use. Note that the underlying NXP LIBUSBSIO C library must be installed on your system for this code to run successfully.

import libusbsio try: # Enumerate available SiO devices devices = libusbsio.SiOBus.enumerate() if not devices: print("No SiO devices found. Ensure device is connected and C library is installed.") else: print(f"Found {len(devices)} SiO devices:") for i, dev_info in enumerate(devices): print(f" [{i}] Path: {dev_info.path}, Serial: {dev_info.serial_number}") # Example: Open the first detected device first_device_path = devices[0].path print(f"\nAttempting to open device at path: {first_device_path}") with libusbsio.SiODevice(first_device_path) as device: print(f"Successfully opened device: {first_device_path}") # Now you can interact with the device, e.g., read/write I2C/SPI # For example, to set an I2C speed (check your device capabilities): # device.set_i2c_speed(100000) # 100 kHz print("Device interaction complete. Device will close automatically.") except libusbsio.SiOError as e: print(f"A libusbsio error occurred: {e}") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingThe `libusbsio` Python wrapper requires the NXP LIBUSBSIO C library to be separately installed on your operating system. Without the C library, the Python package will not function and will raise import errors.
fix
Refer to NXP's documentation or the `libusbsio` Python wrapper's GitHub README for instructions on installing the appropriate C library and drivers for your specific OS (Windows, Linux, macOS).
affects: All versions
gotchaOn Linux, accessing USB devices often requires specific user permissions. If you encounter 'Access Denied' errors, it's likely a permission issue, not a problem with the Python library itself.
fix
Configure `udev` rules to grant your user account access to the NXP SiO devices. Typically, this involves creating a rule in `/etc/udev/rules.d/` with the device's Vendor ID (VID) and Product ID (PID), and adding your user to a group like `plugdev` or `dialout`.
affects: All versions
gotchaThe library is specifically designed for NXP's USB-to-I2C/SPI/GPIO bridge devices. It will not work with generic USB devices or other manufacturers' bridge chips.
fix
Ensure you are using a supported NXP USB-to-I2C/SPI/GPIO bridge device. If you're working with other hardware, a different library will be required.
affects: All versions
Errors
Common errors & fixes
ImportError: DLL load failed while importing _libusbsio_bindings: The specified module could not be found.
The underlying NXP LIBUSBSIO C library (DLLs on Windows) is not installed or not discoverable in the system's PATH.
fix
Install the NXP LIBUSBSIO C library and its necessary drivers/DLLs according to NXP's official instructions. On Windows, ensure the DLLs are in a directory included in your system's PATH environment variable or in the Python script's directory.
libusbsio.SiOError: LIBUSBSIO_STATUS_DEVICE_NOT_FOUND
The NXP SiO device is either not connected, not powered on, or its system-level drivers are not correctly installed or recognized by the operating system.
fix
Verify that your NXP device is securely connected and powered. Check your OS device manager (Windows) or use `lsusb` (Linux) to confirm the device is visible at the OS level. Ensure the correct NXP drivers are installed.
libusbsio.SiOError: LIBUSBSIO_STATUS_ACCESS_DENIED
The current user does not have sufficient permissions to open or interact with the USB device. This is common on Linux systems.
fix
On Linux, you likely need to set up `udev` rules for the NXP device's Vendor ID (VID) and Product ID (PID) to grant access to a specific user group (e.g., `plugdev`) and add your user to that group. Restart your system or log out/in after changing udev rules/group memberships.
Upgrade
Version history
2.2.0latest on PyPI · released Nov 3, 2025
Audit
Dependencies
NXP LIBUSBSIO C libraryrequiredThis Python package is a wrapper around the NXP LIBUSBSIO C library, which must be installed separately on the operating system for libusbsio to function. It is not a Python dependency installable via pip.
Agent activity
2 hits · last 30 days
node
2
Resources
libusbsio — pip install libusbsio · libregistry