A Cython interface to HIDAPI library.
This has been tested with:
- TREZOR Hardware Wallet
- the PIC18F4550 on the development board from CCS with their example program
- the Fine Offset WH3081 Weather Station
It works on Linux, Windows and macOS.
cython-hidapi may be used by one of three licenses as outlined in LICENSE.txt
$ sudo apt-get install python-dev libusb-1.0-0-dev libudev-dev $ sudo pip install --upgrade setuptools $ sudo pip install hidapi
For other download options visit the PyPi page.
Download cython-hidapi archive:
$ git clone https://github.com/trezor/cython-hidapi.git $ cd cython-hidapi
Initialize hidapi submodule:
$ git submodule update --init
Build cython-hidapi extension module:
$ python setup.py build
To use hidraw API instead of libusb add --without-libusb option:
$ python setup.py build --without-libusb
Install cython-hidapi module into your Python distribution:
$ sudo python setup.py install
Test install:
$ python >>> import hid >>>
Try example script:
$ python try.py
For correct functionality under Linux, you need to create a rule file similar to this one in your udev rules directory.
Also you might need to call udevadm control --reload-rules
to reload the rules.