Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: comparison with pyusb #84

Open
danielhrisca opened this issue May 27, 2022 · 2 comments
Open

question: comparison with pyusb #84

danielhrisca opened this issue May 27, 2022 · 2 comments

Comments

@danielhrisca
Copy link

Hello all,

I would like to get your opinion about how python-libusb1 compares with pyusb. The license is obviously different but how about stability, ease of use?

Thank you!

@vpelletier
Copy link
Owner

Hello,

The reason why I implemented python-libusb1 is to have access to all the features libusb has, and especially the asynchronous API (on OSes where libusb supports it). In my understanding, pysub is instead targeted at supporting a variety of usb libraries, abstracting their differences, which means it mostly (only ?) allow access to a common subset of features - which meant (back when I started this project anyway) synchronous API only. I instead chose to rely on libusb to provide me with OS-independence, as it supports *nix, windows, OSX, and there is some android support being worked on AFAIK.

On the ease of use side, I must say that python-libusb1 has accumulated some historical baggage as I got better at abstracting details from C (especially getting the python garbage collector to respect necessary memory allocation lifespan without requiring the library user to have to think too hard about it), making its API larger than strictly necessary. I want to eventually drop such weight, but I have been also trying very hard to keep the existing API as stable as possible.

@mcuee
Copy link

mcuee commented Feb 25, 2023

It seems to me pyusb is more widely used as it started very earlier. It supports libusb-0.1 API and it supports libusb-1.0 API. It also supports OpenUSB (but OpenUSB is kind of dead now).

But yes pyusb still have some features not implemented, like asynchronous transfers and hotplug. But since libusb-1.0 Windows does not support hotplug yet -- it may not be easy to support hotplug under pyusb or python-libusb1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants