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 git+https://github.com/gschwaer/pycusb.git

Development

Clone 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.0.0.tar.gz (4.3 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.0.0-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for pycusb-0.0.0.tar.gz
Algorithm Hash digest
SHA256 35c0e695b50a26c3ec3627fde129ff2da63c7c747193161a3e7ac906afe8d641
MD5 2a5a6fc55bd7b6589d5270d7315159a9
BLAKE2b-256 9405dee4c6879f071779c8d33426d9da8583a77d08d3ac14c4394f30fbb79686

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycusb-0.0.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.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pycusb-0.0.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.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 06207e1db04f376c07dd1c284e9e007579b7952a5aae4f851b2a5088996f40de
MD5 8e243227f80a6a660fb9dd238cf68592
BLAKE2b-256 c8da82dc84d9d8047bc2a2bea2f2614bed6d6f38d2d9a4015a1e2f1c22e216a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycusb-0.0.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