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

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

Project details


Download files

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

Source Distribution

hid-1.0.7.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

hid-1.0.7-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file hid-1.0.7.tar.gz.

File metadata

  • Download URL: hid-1.0.7.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for hid-1.0.7.tar.gz
Algorithm Hash digest
SHA256 3f809e292ab52c4435ad1442c8ef205be4c9ca4eeb80fb47c7d98e0c75527b2a
MD5 6ed8b8fe9753f515bd86cdce553d7cab
BLAKE2b-256 d39c6f33de7dbf6f9054ebf312c01b3440040526fb133f3e7de2b5fe81184163

See more details on using hashes here.

File details

Details for the file hid-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: hid-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for hid-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8a4f1b081202599018564c4fbc4805d9b97b9c2495f2be177a1ed9600940436d
MD5 2cd9a2120b5d80e8a781c1eff23ee042
BLAKE2b-256 8500e830f0ecfe43bbc7f30509fb7cd97945a4a23eab8b8afdcd0865c417a18e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page