USB/IP server backed by libusb, with persistent bind allowlist and HTTP control plane
Project description
pyusbip
A pure-Python USB/IP server backed by libusb. Shares USB devices from macOS (or any libusb host) into a Linux USB/IP client — e.g. Docker Desktop's VM, a remote Linux box, or a CI runner.
Forked from tumayt/pyusbip.
Install
uv tool install git+https://github.com/jenish-rudani/pyusbip
Run
sudo pyusbip # USB/IP on :3240, HTTP control on :3241
sudo pyusbip --vid 0x0483 # only export ST devices
sudo pyusbip --help
sudo is required for libusb to claim devices on macOS.
HTTP control plane
JSON over HTTP on 127.0.0.1:3241. CORS allow-all.
GET /health— uptime, device counts, API version.GET /devices— list of libusb-visible devices withbus_id, VID/PID, strings, andbind_state("shared"or"attached").
Library use
import asyncio, usb1
from pyusbip import USBIPServer, ControlPlane
async def main():
ctx = usb1.USBContext(); ctx.open()
loop = asyncio.get_event_loop()
server = USBIPServer(loop, ctx, vid_filter={0x0483})
control = ControlPlane(loop, ctx, server)
await server.start(); await control.start()
await asyncio.Event().wait()
asyncio.run(main())
Development
uv tool install ruff pre-commit
pre-commit install
ruff format . && ruff check . --fix
Version lives in pyusbip/__init__.py; pyproject.toml reads it
dynamically. Bump, tag, push.
Requirements
- Python 3.8+
- libusb1
- Root to claim devices
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyusbip-2.0.1.tar.gz.
File metadata
- Download URL: pyusbip-2.0.1.tar.gz
- Upload date:
- Size: 29.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed82ba7e6e11b0c3bea349b11b2f90087cd5e642368c5d6687e3daaa474e29c1
|
|
| MD5 |
75f55555295d832689ad87516559eee9
|
|
| BLAKE2b-256 |
06eb702efce8db66a85145e6a3febf312faffb02b4838a639f16932fbdd80f92
|
Provenance
The following attestation bundles were made for pyusbip-2.0.1.tar.gz:
Publisher:
release.yml on jenish-rudani/pyusbip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyusbip-2.0.1.tar.gz -
Subject digest:
ed82ba7e6e11b0c3bea349b11b2f90087cd5e642368c5d6687e3daaa474e29c1 - Sigstore transparency entry: 1598044077
- Sigstore integration time:
-
Permalink:
jenish-rudani/pyusbip@f9cab39d631456aacee3255d1206fe298ea25ced -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/jenish-rudani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f9cab39d631456aacee3255d1206fe298ea25ced -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyusbip-2.0.1-py3-none-any.whl.
File metadata
- Download URL: pyusbip-2.0.1-py3-none-any.whl
- Upload date:
- Size: 30.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62a5c65fc69e29a90fefd8466858e026b802cf8bbfb1b849a2290654f07dcb0d
|
|
| MD5 |
ca7b8c2ecdb47d2b3b30a5c68aa100f7
|
|
| BLAKE2b-256 |
c2ba376dc040fac8ef61b16d07cb0d9b66076445a75e94010c3e00c5c817c7ff
|
Provenance
The following attestation bundles were made for pyusbip-2.0.1-py3-none-any.whl:
Publisher:
release.yml on jenish-rudani/pyusbip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyusbip-2.0.1-py3-none-any.whl -
Subject digest:
62a5c65fc69e29a90fefd8466858e026b802cf8bbfb1b849a2290654f07dcb0d - Sigstore transparency entry: 1598044180
- Sigstore integration time:
-
Permalink:
jenish-rudani/pyusbip@f9cab39d631456aacee3255d1206fe298ea25ced -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/jenish-rudani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f9cab39d631456aacee3255d1206fe298ea25ced -
Trigger Event:
push
-
Statement type: