Proposal: Python API #410
Replies: 2 comments 5 replies
-
There are few ways to address this:
I believe first option is much easier overall. That said, I would not mind implementing -j, which will need changing command line parsing and output quite extensively (the only reason it was not done just yet). |
Beta Was this translation helpful? Give feedback.
-
Implementing |
Beta Was this translation helpful? Give feedback.
-
@mvp I'm a user of
uhubctl
for a couple of projects I work on that require USB device integration with this project managing device states. I have to commend you and the other contributors for the work done here. Phenomenal.Anyways, all of these projects use Python as the core language as it can cover really every aspect I need. That being said, using
uhubctl
can sometimes be a challenge for a couple of reasons:uhubctl
, I have to open a dedicated subprocess to use your CLI and then use some pretty advanced regex to parse the output. As a side-effect, this is a security hole as well.These issues are pretty obvious, especially 1, so I'd like to propose a Python wrapper library for
uhubctl
. I want to fully disclose I have little experience with C and creating Python bindings for C (most of my C-like experience is Arduino), but considering the projects that support Python through C bindings (OpenCV, NumPy, TensorFlow, etc.), doing this is well within the realm of possibility.I'll have to experiment with this to find the optimal approach, but I thought I'd get your opinion on it.
Hope to hear back,
Jules
Beta Was this translation helpful? Give feedback.
All reactions