hidapi 0.15.0


pip install hidapi

  Latest version

Released: Dec 09, 2025

Project Links

Meta
Author: Pavol Rusnak
Maintainer: Pavol Rusnak

Classifiers

Operating System
  • MacOS :: MacOS X
  • Microsoft :: Windows
  • POSIX

License
  • OSI Approved :: BSD License
  • OSI Approved :: GNU General Public License v3 (GPLv3)

Programming Language
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

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

License

cython-hidapi may be used by one of three licenses as outlined in LICENSE.txt

Install

$ 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 --recursive https://github.com/trezor/cython-hidapi.git
    $ cd cython-hidapi
  2. Build cython-hidapi extension module:

    $ python setup.py build

    On Linux, the hidraw API is now used by default, and the libusb API is not included. That is, –without-libusb is now the default behavior. To force the use of the libusb API instead, use the –with-libusb option:

    $ python setup.py build --with-libusb

    Or you can also use the environment variable:

    $ export HIDAPI_WITH_LIBUSB=1
    $ python setup.py build
  3. Install cython-hidapi module into your Python distribution:

    $ sudo python setup.py install

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

    $ pip install -e .
  4. Test install:

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

    $ python try.py

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

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: https://trezor.github.io/cython-hidapi/.

Wheel compatibility matrix

Platform CPython 3.8 CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13 CPython 3.14 CPython (additional flags: t) 3.14
macosx_10_13_x86_64
macosx_10_15_x86_64
macosx_10_9_x86_64
macosx_11_0_arm64
manylinux2014_x86_64
manylinux_2_17_x86_64
manylinux_2_28_aarch64
manylinux_2_28_i686
musllinux_1_2_aarch64
musllinux_1_2_i686
musllinux_1_2_x86_64
win32
win_amd64

Files in release

hidapi-0.15.0-cp310-cp310-macosx_10_9_x86_64.whl (68.9KiB)
hidapi-0.15.0-cp310-cp310-macosx_11_0_arm64.whl (68.5KiB)
hidapi-0.15.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1015.2KiB)
hidapi-0.15.0-cp310-cp310-manylinux_2_28_aarch64.whl (1.5MiB)
hidapi-0.15.0-cp310-cp310-manylinux_2_28_i686.whl (1.6MiB)
hidapi-0.15.0-cp310-cp310-musllinux_1_2_aarch64.whl (653.5KiB)
hidapi-0.15.0-cp310-cp310-musllinux_1_2_i686.whl (649.3KiB)
hidapi-0.15.0-cp310-cp310-musllinux_1_2_x86_64.whl (655.4KiB)
hidapi-0.15.0-cp310-cp310-win32.whl (58.8KiB)
hidapi-0.15.0-cp310-cp310-win_amd64.whl (65.5KiB)
hidapi-0.15.0-cp311-cp311-macosx_10_9_x86_64.whl (68.9KiB)
hidapi-0.15.0-cp311-cp311-macosx_11_0_arm64.whl (68.6KiB)
hidapi-0.15.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0MiB)
hidapi-0.15.0-cp311-cp311-manylinux_2_28_aarch64.whl (1.5MiB)
hidapi-0.15.0-cp311-cp311-manylinux_2_28_i686.whl (1.6MiB)
hidapi-0.15.0-cp311-cp311-musllinux_1_2_aarch64.whl (683.4KiB)
hidapi-0.15.0-cp311-cp311-musllinux_1_2_i686.whl (679.7KiB)
hidapi-0.15.0-cp311-cp311-musllinux_1_2_x86_64.whl (681.4KiB)
hidapi-0.15.0-cp311-cp311-win32.whl (58.7KiB)
hidapi-0.15.0-cp311-cp311-win_amd64.whl (65.7KiB)
hidapi-0.15.0-cp312-cp312-macosx_10_13_x86_64.whl (68.5KiB)
hidapi-0.15.0-cp312-cp312-macosx_11_0_arm64.whl (68.0KiB)
hidapi-0.15.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0MiB)
hidapi-0.15.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.5MiB)
hidapi-0.15.0-cp312-cp312-manylinux_2_28_i686.whl (1.6MiB)
hidapi-0.15.0-cp312-cp312-musllinux_1_2_aarch64.whl (696.9KiB)
hidapi-0.15.0-cp312-cp312-musllinux_1_2_i686.whl (680.9KiB)
hidapi-0.15.0-cp312-cp312-musllinux_1_2_x86_64.whl (700.8KiB)
hidapi-0.15.0-cp312-cp312-win32.whl (58.7KiB)
hidapi-0.15.0-cp312-cp312-win_amd64.whl (65.5KiB)
hidapi-0.15.0-cp313-cp313-macosx_10_13_x86_64.whl (67.4KiB)
hidapi-0.15.0-cp313-cp313-macosx_11_0_arm64.whl (67.1KiB)
hidapi-0.15.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0MiB)
hidapi-0.15.0-cp313-cp313-manylinux_2_28_aarch64.whl (1.5MiB)
hidapi-0.15.0-cp313-cp313-manylinux_2_28_i686.whl (1.6MiB)
hidapi-0.15.0-cp313-cp313-musllinux_1_2_aarch64.whl (692.0KiB)
hidapi-0.15.0-cp313-cp313-musllinux_1_2_i686.whl (673.4KiB)
hidapi-0.15.0-cp313-cp313-musllinux_1_2_x86_64.whl (693.6KiB)
hidapi-0.15.0-cp313-cp313-win32.whl (58.3KiB)
hidapi-0.15.0-cp313-cp313-win_amd64.whl (64.8KiB)
hidapi-0.15.0-cp314-cp314-macosx_10_15_x86_64.whl (67.9KiB)
hidapi-0.15.0-cp314-cp314-macosx_11_0_arm64.whl (67.7KiB)
hidapi-0.15.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0MiB)
hidapi-0.15.0-cp314-cp314-manylinux_2_28_aarch64.whl (1.5MiB)
hidapi-0.15.0-cp314-cp314-manylinux_2_28_i686.whl (1.6MiB)
hidapi-0.15.0-cp314-cp314-musllinux_1_2_aarch64.whl (691.0KiB)
hidapi-0.15.0-cp314-cp314-musllinux_1_2_i686.whl (673.7KiB)
hidapi-0.15.0-cp314-cp314-musllinux_1_2_x86_64.whl (690.2KiB)
hidapi-0.15.0-cp314-cp314-win32.whl (59.7KiB)
hidapi-0.15.0-cp314-cp314-win_amd64.whl (66.1KiB)
hidapi-0.15.0-cp314-cp314t-macosx_10_15_x86_64.whl (69.2KiB)
hidapi-0.15.0-cp314-cp314t-macosx_11_0_arm64.whl (69.8KiB)
hidapi-0.15.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0MiB)
hidapi-0.15.0-cp314-cp314t-manylinux_2_28_aarch64.whl (1.6MiB)
hidapi-0.15.0-cp314-cp314t-manylinux_2_28_i686.whl (1.6MiB)
hidapi-0.15.0-cp314-cp314t-musllinux_1_2_aarch64.whl (733.8KiB)
hidapi-0.15.0-cp314-cp314t-musllinux_1_2_i686.whl (705.9KiB)
hidapi-0.15.0-cp314-cp314t-musllinux_1_2_x86_64.whl (733.3KiB)
hidapi-0.15.0-cp314-cp314t-win32.whl (64.7KiB)
hidapi-0.15.0-cp314-cp314t-win_amd64.whl (73.0KiB)
hidapi-0.15.0-cp38-cp38-macosx_10_9_x86_64.whl (70.3KiB)
hidapi-0.15.0-cp38-cp38-macosx_11_0_arm64.whl (70.2KiB)
hidapi-0.15.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0MiB)
hidapi-0.15.0-cp38-cp38-manylinux_2_28_aarch64.whl (1.5MiB)
hidapi-0.15.0-cp38-cp38-manylinux_2_28_i686.whl (1.6MiB)
hidapi-0.15.0-cp38-cp38-musllinux_1_2_aarch64.whl (679.6KiB)
hidapi-0.15.0-cp38-cp38-musllinux_1_2_i686.whl (656.0KiB)
hidapi-0.15.0-cp38-cp38-musllinux_1_2_x86_64.whl (682.0KiB)
hidapi-0.15.0-cp38-cp38-win32.whl (59.8KiB)
hidapi-0.15.0-cp38-cp38-win_amd64.whl (66.6KiB)
hidapi-0.15.0-cp39-cp39-macosx_10_9_x86_64.whl (69.4KiB)
hidapi-0.15.0-cp39-cp39-macosx_11_0_arm64.whl (69.1KiB)
hidapi-0.15.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1014.8KiB)
hidapi-0.15.0-cp39-cp39-manylinux_2_28_aarch64.whl (1.5MiB)
hidapi-0.15.0-cp39-cp39-manylinux_2_28_i686.whl (1.6MiB)
hidapi-0.15.0-cp39-cp39-musllinux_1_2_aarch64.whl (651.8KiB)
hidapi-0.15.0-cp39-cp39-musllinux_1_2_i686.whl (649.7KiB)
hidapi-0.15.0-cp39-cp39-musllinux_1_2_x86_64.whl (654.2KiB)
hidapi-0.15.0-cp39-cp39-win32.whl (59.1KiB)
hidapi-0.15.0-cp39-cp39-win_amd64.whl (65.9KiB)
hidapi-0.15.0.tar.gz (180.7KiB)
No dependencies