hid
ctypes bindings for hidapi
What it is and what it does
This package wraps the hidapi C library with ctypes bindings, allowing Python code to enumerate, open, and communicate with USB human interface devices like keyboards, mice, and game controllers. It is typically used in applications that need direct, low-level access to HID devices for custom control or data collection.
The package itself has no Python runtime dependencies and installs as a pure wheel, but it requires the hidapi library to be installed separately on your system—a prerequisite that varies by operating system and distribution. Once both are in place, you can query device properties and send/receive data through a simple context-manager interface.
Use it for:
- Read input from custom USB game controllers or joysticks in real-time applications.
- Enumerate and communicate with USB peripherals for hardware testing or diagnostics.
- Build cross-platform tools that control USB HID devices like programmable keyboards or LED controllers.
- Capture raw HID reports from devices for protocol reverse-engineering or data logging.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings to the hidapi library for communicating with USB human interface devices (keyboards, mice, joysticks, etc.) at a low level.
Yes, if you need to work with USB HID devices and are comfortable installing the hidapi system library separately. The package is stable (MIT licensed, no known vulnerabilities, low install friction), though maintenance is aging—last release was 190 days ago. It is the standard Python binding for hidapi and has modest but steady adoption. Not suitable if you cannot install native system libraries or need active development support.
Install
hid on PyPI
pip
pip install hiduv
uv add hidpoetry
poetry add hidInstalling hid
Before you install
Low install friction—pure Python wheel with no runtime dependencies. However, the underlying hidapi C library must be installed separately on your system before the package is useful, which adds a platform-specific setup step outside pip.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations.
Quickstart
pip install hid
import hid
vid = 0x046d # Your device's vendor ID
pid = 0xc534 # Your device's product ID
with hid.Device(vid, pid) as h:
print(f'Device: {h.product}')
print(f'Manufacturer: {h.manufacturer}')
The hidapi C library must be installed on your system before importing hid (e.g., apt install libhidapi-hidraw0 on Ubuntu, brew install hidapi on macOS, or built from source on some platforms).
Verify before relying
- Whether the package works with all Python 3.x versions or has undocumented constraints.
- Current state of compatibility with modern hidapi versions and whether breaking changes are tracked.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 190 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 80,150/month — #14,316 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hid-1.0.9-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
hidapiProvides a Python interface to HIDAPI, enabling…
unclear · top 5,000 on PyPI
phidget22Phidget22 is the official Python library for…
permissive · top 15,000 on PyPI
brainstemProvides Python bindings to control and…
unclear · top 15,000 on PyPI
pyusbPyUSB provides Python access to USB devices on…
permissive · top 5,000 on PyPI
inputsProvides cross-platform Python access to…
permissive · top 15,000 on PyPI
usb-devicesMaps, describes, and resets USB devices on a…
permissive · top 15,000 on PyPI
libusb-packageBundles libusb shared libraries for multiple…
permissive · top 5,000 on PyPI
pyftdiPyFtdi provides a pure-Python user-space driver…
permissive · top 15,000 on PyPI
libusb1Python wrapper for libusb-1.0 that enables…
copyleft · top 15,000 on PyPI
binho-host-adapterControls Binho Multi-Protocol USB Host Adapters…
permissive · top 15,000 on PyPI