• Stars
    star
    255
  • Rank 159,729 (Top 4 %)
  • Language Cython
  • License
    Other
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐍 Python wrapper for the HIDAPI

cython-hidapi

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/.

More Repositories

1

trezor-firmware

πŸ”’ Trezor Firmware Monorepo
C
1,286
star
2

python-mnemonic

🐍 Mnemonic code for generating deterministic keys, BIP39
Python
762
star
3

trezor-suite

🍬 Trezor Suite Monorepo
TypeScript
619
star
4

blockbook

πŸ“˜ Trezor address/account balance backend
Go
585
star
5

trezor-crypto

πŸ”’ Don't use this repo, use the new monorepo instead:
C
493
star
6

trezor-core

πŸ”’ Don't use this repo, use the new monorepo instead:
Python
353
star
7

connect

πŸ”— A platform for easy integration of Trezor into 3rd party services
JavaScript
350
star
8

trezor-mcu

πŸ”’ Don't use this repo, use the new monorepo instead:
C
318
star
9

trezord-go

😈 Trezor Communication Daemon (written in Go)
C
226
star
10

python-trezor

🐍 Don't use this repo, use the new monorepo instead:
Python
203
star
11

trezor-hardware

πŸ”§ Hardware design of Trezor
171
star
12

python-shamir-mnemonic

Python
155
star
13

trezor.js

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/connect instead
JavaScript
95
star
14

trezor-common

πŸ”’ Don't post issues/PRs to here, use the new monorepo:
Python
89
star
15

trezor-android

πŸ“± TREZOR Communication Library for Android
Java
78
star
16

hd-wallet

πŸ’° High-performance Bitcoin HD Wallet in Javascript
JavaScript
56
star
17

trezor-password-manager

Password Management via TREZOR
SCSS
42
star
18

data

πŸ“¦ Data files for Trezor
HTML
39
star
19

trezor-wallet

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
JavaScript
29
star
20

trezor-user-env

Development tool for Trezor developers
Python
24
star
21

trezor-link

Javascript module for integrating TREZOR into Node.js and web applications.
TypeScript
18
star
22

connect-explorer

Connect Examples
JavaScript
12
star
23

trezor-suite-guide

User Guide present in Trezor Suite
11
star
24

rng-test

🎲 Random Number Generator (RNG) tests
C
10
star
25

community

πŸ‘« TREZOR Developer Community Discussion
9
star
26

trezor-ui-components

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
JavaScript
9
star
27

trezor-storage

πŸ”’ Don't use this repo, use the new monorepo instead:
C
9
star
28

coinjoin-backend

Python
6
star
29

omni-trezor

OMNI Wallet for Trezor
JavaScript
6
star
30

ui

🍺 User Interface Mockups and Experiments
HTML
6
star
31

trezor-rollout

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
JavaScript
5
star
32

trezor-test-scenarios

Python
5
star
33

trezor-core-ui

HTML
5
star
34

trezor-storage-test

πŸ”’ Don't use this repo, use the new monorepo instead:
Python
4
star
35

trezor-onboarding

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
TypeScript
4
star
36

.github

4
star
37

trezor-flags

JavaScript
4
star
38

trezor-translations-manager

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
JavaScript
3
star
39

trezor-blockchain-link

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
TypeScript
3
star
40

upysize

Tool for decreasing the size of compiled micropython code
Python
3
star
41

trezor-docker-images

Collection of docker images and configurations used across various trezor projects.
Dockerfile
2
star
42

binsize

Tool to analyze the size of a binary from .elf file
Python
2
star
43

definitions

Python
1
star