Skip to main content

A Cython interface to the hidapi from

Project description


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.

Software Dependencies


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.

Build from source

  1. Download cython-hidapi archive:

    $ git clone
    $ cd cython-hidapi
  2. Initialize hidapi submodule:

    $ git submodule update --init
  3. Build cython-hidapi extension module:

    $ python build

    To use hidraw API instead of libusb add –without-libusb option:

    $ python build --without-libusb
  4. Install cython-hidapi module into your Python distribution:

    $ sudo python install

    Alternatively, you can run pip directly, which will call the necessary build and install commands:

    $ pip install -e .
  5. Test install:

    $ python
    >>> import hid
  6. Try example script:

    $ python

Udev rules

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.


Documentation can be built using Sphinx:

$ cd docs && make html

The HTML output will be in docs/_build/html.

The documentation is extracted from the code using autodoc.

Note that the build output is used. So rebuilt the package before generating documentation.

Built documentation is also deployed to:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hidapi-0.14.0.tar.gz (143.1 kB view hashes)

Uploaded source

Built Distributions

hidapi-0.14.0-cp312-cp312-win_amd64.whl (69.8 kB view hashes)

Uploaded cp312

hidapi-0.14.0-cp312-cp312-win32.whl (62.1 kB view hashes)

Uploaded cp312

hidapi-0.14.0-cp311-cp311-win_amd64.whl (58.2 kB view hashes)

Uploaded cp311

hidapi-0.14.0-cp311-cp311-win32.whl (52.3 kB view hashes)

Uploaded cp311

hidapi-0.14.0-cp310-cp310-win_amd64.whl (59.1 kB view hashes)

Uploaded cp310

hidapi-0.14.0-cp310-cp310-win32.whl (53.0 kB view hashes)

Uploaded cp310

hidapi-0.14.0-cp39-cp39-win_amd64.whl (60.0 kB view hashes)

Uploaded cp39

hidapi-0.14.0-cp39-cp39-win32.whl (53.7 kB view hashes)

Uploaded cp39

hidapi-0.14.0-cp38-cp38-win_amd64.whl (60.1 kB view hashes)

Uploaded cp38

hidapi-0.14.0-cp38-cp38-win32.whl (53.8 kB view hashes)

Uploaded cp38

hidapi-0.14.0-cp37-cp37m-win_amd64.whl (59.4 kB view hashes)

Uploaded cp37

hidapi-0.14.0-cp37-cp37m-win32.whl (53.3 kB view hashes)

Uploaded cp37

hidapi-0.14.0-cp36-cp36m-win_amd64.whl (64.2 kB view hashes)

Uploaded cp36

hidapi-0.14.0-cp36-cp36m-win32.whl (56.9 kB view hashes)

Uploaded cp36

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page