Module name conflicts with official bindings #39
Description
Is there a reason why this package conflicts the "gpiod" module name?
The official python bindings are now available as "libgpiod" via pypi, and provide a "gpiod" module. They are currently broken, but I'm looking into repackaging in such a way that the official bindings are widely accessible to the Python community and proffering up a patch to Bart in the hopes we can get them sorted.
However when I "import gpiod", or write code that does so, I have no guarantee if I get the official bindings or yours. The current state of deb packages vs Python bindings, venvs versus not venvs and various broken packages means I am writing defensive code like this:
if hasattr(gpiod, "chip") # gpiod
...
elif hasattr(gpiod, "Chip"): # libgpiod
...
Which isn't great, because gpiod
is about 2-3x slower than libgpiod
for raw GPIO toggle throughput, so they are not totally equivalent.
There exists an "smsbus" pure Python package that used the name "smbus2" to work around this, and I humbly suggest that "gpiod" - this library - adopts something like this and renames the module to avoid conflicts.
Since it's not reasonable to expect that the official Python bindings step aside for a pure-Python alternative (though, in some ways I'd prefer that was the case), perhaps renaming this module is appropriate?