Python wrapper for the uhubctl project.
Project description
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
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
File details
Details for the file pyhubctl-1.0.0.tar.gz
.
File metadata
- Download URL: pyhubctl-1.0.0.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 476fe1e3de021d02c9b916550c163043842c55a43122cd43cdf635a9bd62f69b |
|
MD5 | 05983cf0feb46d8de3629f05cce0927d |
|
BLAKE2b-256 | 80e40247939ed306bf40c2844fd3c3ae16d5a15e4f99e5b8893a0d564251fc2e |
File details
Details for the file pyhubctl-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pyhubctl-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bbc7c14c7319b487112b4fe9b3c2c9aaba6863377d878901ca694093558a434 |
|
MD5 | 61712bf61388374edc5e5ee8ed67e205 |
|
BLAKE2b-256 | 44faa4743fdc2505f70e761cb035c2292917dc17c893b5bb2ace457da911eeb8 |