Skip to main content

A Cython interface to the hidapi from https://github.com/libusb/hidapi

Project description

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 https://github.com/trezor/cython-hidapi.git
    $ cd cython-hidapi
    
  2. Initialize hidapi submodule:

    $ git submodule update --init
    
  3. 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
    
  4. 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 .
    
  5. Test install:

    $ python
    >>> import hid
    >>>
    
  6. 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/.

Project details


Download files

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

Files for hidapi, version 0.11.0.post2
Filename, size File type Python version Upload date Hashes
Filename, size hidapi-0.11.0.post2-cp310-cp310-macosx_10_9_x86_64.whl (48.3 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl (406.3 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (819.8 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (810.3 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp310-cp310-win32.whl (43.7 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp310-cp310-win_amd64.whl (48.3 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp36-cp36m-macosx_10_9_x86_64.whl (46.9 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl (388.5 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (803.3 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (795.8 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp36-cp36m-win32.whl (43.4 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp36-cp36m-win_amd64.whl (48.1 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp37-cp37m-macosx_10_9_x86_64.whl (46.8 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl (389.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (804.1 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (796.7 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp37-cp37m-win32.whl (43.3 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp37-cp37m-win_amd64.whl (47.9 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp38-cp38-macosx_10_9_x86_64.whl (47.3 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl (415.4 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (824.6 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (815.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp38-cp38-win32.whl (43.8 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp38-cp38-win_amd64.whl (48.4 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp39-cp39-macosx_10_9_x86_64.whl (48.3 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (405.5 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (815.9 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (807.6 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp39-cp39-win32.whl (43.7 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size hidapi-0.11.0.post2-cp39-cp39-win_amd64.whl (48.3 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size hidapi-0.11.0.post2.tar.gz (136.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page