Skip to main content

ctypes bindings for hidapi

Project description

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


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
Include = /etc/pacman.d/mirrorlist
  1. Install hidapi
pacman -Sy hidapi


Binary distributions are available through EPEL.

yum install hidapi


Binary distributions are available.

dnf install hidapi


Binary distributions are available.

apt install libhidapi-hidraw0


apt install libhidapi-libusb0


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


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

Binary distributions are provided by libusb/hidapi


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

It should be noted that at this time, brew still uses the old signal11 repository which has long since been abandond. See Homebrew/homebrew-core#41122.

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}')

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 hid, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size hid-1.0.4-py2-none-any.whl (3.8 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size hid-1.0.4.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

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