File: PKG-INFO

package info (click to toggle)
python-hidapi 0.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,192 kB
  • sloc: ansic: 5,960; python: 264; makefile: 7
file content (138 lines) | stat: -rw-r--r-- 3,709 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Metadata-Version: 2.4
Name: hidapi
Version: 0.15.0
Summary: A Cython interface to the hidapi from https://github.com/libusb/hidapi
Home-page: https://github.com/trezor/cython-hidapi
Author: Pavol Rusnak
Author-email: pavol@rusnak.io
Maintainer: Pavol Rusnak
Maintainer-email: pavol@rusnak.io
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: License :: OSI Approved :: BSD License
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
License-File: LICENSE-bsd.txt
License-File: LICENSE-gpl3.txt
License-File: LICENSE-orig.txt
License-File: LICENSE.txt
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: license-file
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: summary

cython-hidapi
=============

.. contents::

Description
-----------

A Cython interface to `HIDAPI <https://github.com/libusb/hidapi>`_ library.

This has been tested with:

* `TREZOR <https://trezor.io/>`_ 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
---------------------

* `Python <http://python.org>`_
* `Cython <http://cython.org>`_
* hidraw or libusb+libudev on Linux

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 <https://pypi.python.org/pypi/hidapi/>`_.

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 <https://raw.githubusercontent.com/trezor/trezor-common/master/udev/51-trezor.rules>`_
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/ <https://trezor.github.io/cython-hidapi/>`_.