Skip to main content

Python implementation of the cusb interface for managed USB hubs

Project description

pycusb

A python library for managed USB hubs that are usually operated by a command line tool called cusbi (Linux Intel), cusba (Linux Arm), cusbm (Mac), or CUSBC/CUSBCTL (Windows), e.g., hubs from the companies EXSYS and StarTech.

Usage

from cusb import CUsb
import time

# Example:
path_to_device = "/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_B0036Y2H-if00-port0"
port = 1

with CUsb(path_to_device) as hub:
    hub.port_power_on(port, False)
    time.sleep(1)
    hub.port_power_on(port, True)

Installation

as library

Add pycusb to your pyproject.toml:

[project]
dependencies = [
    "pycusb",
]

as CLI tool

Create and activate a virtual environment, then run

pip install pycusb

Development

Clone the repo, create and activate a virtual environment, then install dependencies with:

pip install -e '.[dev]'

Test with

pytest test/test.py

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

pycusb-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

pycusb-0.1.0-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pycusb-0.1.0.tar.gz.

File metadata

  • Download URL: pycusb-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pycusb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed5d602aba0de6e783143882cb0afa8b5a760936b826dd46a7cc787e85b764d3
MD5 ac3f55f0f299d8ee7ebeca213492f3dc
BLAKE2b-256 02ef2aa249e5df7fa519e7196748b617a8bbabc3865302375920ec037e048e70

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycusb-0.1.0.tar.gz:

Publisher: release.yaml on gschwaer/pycusb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycusb-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pycusb-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pycusb-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fe9a0ea5a6d8c06d9d4bca886a766f3ba7e824ab84fca9819c2244d8df4ea14c
MD5 011940f2ba32fc95128ac947aa9b2c45
BLAKE2b-256 301a8d91b1ee89b3a3a4786195cc3576ab7e90354f941898dd8fc507c664806b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycusb-0.1.0-py2.py3-none-any.whl:

Publisher: release.yaml on gschwaer/pycusb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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