PyHubCtl
Python wrapper for the uhubctl project.
Quick Start
Installation
pyhubctl requires uhubctl to be installed and on PATH for your system. Follow the guide provided by uhubctl here: https://github.com/mvp/uhubctl#compiling
Attempts to run this library without proper installation of uhubctl will result in errors being thrown.
Install from PyPI:
pip install pyhubctl
Install from source:
git clone https://github.com/DuraTech-Industries/pyhubctl.git cd pyhubctl pip install .
Quick Start
pyhubctl has two main classes for use: PyHubCtl and Configuration. They’re both pretty self-explanatory, but PyHubCtl is what you use to run uhubctl, and Configuration is what you use to configure how uhubctl runs.
Configuration contains attributes that correspond directly to the arguments uhubctl expects. Pass an instance of this class to the run method of PyHubCtl. This run method will return what uhubctl outputs, or raise an error if something went wrong.
As an example, here is how you might toggle all of the ports on a USB-hub:
from pyhubctl import Configuration, PyHubCtl phc = PyHubCtl() phc.run(Configuration(location="1-4"))
Or a specific set of ports:
from pyhubctl import Configuration, PyHubCtl phc = PyHubCtl() phc.run(Configuration(location="1-4", ports="3,4"))
Making Changes & Contributing
This project uses pre-commit, please make sure to install it before making any changes:
pip install pre-commit cd pyhubctl pre-commit install
It is a good idea to update the hooks to the latest version:
pre-commit autoupdate
Release files for pyhubctl 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyhubctl-1.0.0.tar.gz | 24.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyhubctl-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.5 kB
Release files / pyhubctl-1.0.0.tar.gz
| Download URL | pyhubctl-1.0.0.tar.gz |
|---|---|
| Size | 24.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
476fe1e3de021d02c9b916550c163043842c55a43122cd43cdf635a9bd62f69b
|
|
BLAKE2b-256 checksum How to use checksums |
80e40247939ed306bf40c2844fd3c3ae16d5a15e4f99e5b8893a0d564251fc2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.12
|
Release files / pyhubctl-1.0.0-py3-none-any.whl
| Download URL | pyhubctl-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4bbc7c14c7319b487112b4fe9b3c2c9aaba6863377d878901ca694093558a434
|
|
BLAKE2b-256 checksum How to use checksums |
44faa4743fdc2505f70e761cb035c2292917dc17c893b5bb2ace457da911eeb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.12
|