Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hid

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hid

ctypes bindings for hidapi

  • 1.0.6
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc