Giter Site home page Giter Site logo

pyhidapi's Introduction

Installing pyhidapi

pyhidapi is available on PyPI and can be installed using pip.

pip install hid

pyhidapi is dependant upon the hidapi library, which must be installed separately.

Installing hidapi

Linux

Installation procedures vary depending on your distribution.

Arch Linux

Binary distributions are available in the community repository.

  1. Enable the community repository in /etc/pacman.conf
[community]
Include = /etc/pacman.d/mirrorlist
  1. Install hidapi
pacman -Sy hidapi

CentOS/RHEL

Binary distributions are available through EPEL.

yum install hidapi

Fedora

Binary distributions are available.

dnf install hidapi

Ubuntu/Debian

Binary distributions are available.

apt install libhidapi-hidraw0

or

apt install libhidapi-libusb0

Others

Binary distributions may be available in your package repositories. If not, you can build from source as described in the libusb/hidapi README.

Windows

Installation procedure for Windows is described in the libusb/hidapi README

Binary distributions are provided by libusb/hidapi

OSX

There are currently no official binary distributions for Mac, so you must build hidapi yourself.

Installation instructions are described in the libusb/hidapi README

You can also use brew:

brew install hidapi

FreeBSD

Binary distributions are available.

pkg install -g 'py3*-hid'

Sample usage code

The details about a HID device can be printed with following code:

import hid

vid = 0x046d	# Change it for your device
pid = 0xc534	# Change it for your device

with hid.Device(vid, pid) as h:
	print(f'Device manufacturer: {h.manufacturer}')
	print(f'Product: {h.product}')
	print(f'Serial Number: {h.serial}')

pyhidapi's People

Contributors

apmorton avatar thebiguno avatar qbicz avatar antojk avatar 3demax avatar echterago avatar abcminiuser avatar olsoneric avatar jnyjny avatar ezefranca avatar geneccx avatar jpewdev avatar 0mp avatar mayanksuman avatar rginda avatar nzsmartie avatar scotty007 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.