Skip to main content

A package that simplifies USB/HID communications on windows

Project description


This project aims to be a simple USB/HID user application space (hence no system drivers needed) 100% python package (without C extensions). Initially targeting simple HID devices management.

The vision for this project is to be something similar to PySerial or PyParallel but for USB/HID hardware enthusiasts.


  • All python code, using ctypes

  • Top level handling of HID events (usage events calling hook function handlers)

Current limitations

Depending on your application you might find these limitations

  • Windows only (so far…)

  • Maybe speed. I’ve had feedback by some users that speed is not a problem for high data throughput, but I think you might hit some Python limits if you are require any real time processing.

Installation Instructions


The most convenient way of installing is using easy_install or pip, I recommend to do this once you are familiar with the library as you might loose track of the example source files, but you can take a look to the example or the source browsing the github repository.

If using a source package (.zip) from PyPi un-zip your file, or get the source from the main repository and run the familiar install command line is sufficient, setuptools or distribute (for python 3) are required.


So far only Windows OS it’s supported.

Using pywinusb.hid

View the ./examples directory for some (ok, few right now) scripts. These show, for instance, how to use pywinusb.hid to handle events from HID class devices usages events.

Latest code and some Wiki information can be found on the main project code page.


More on this later…

  • The module contains a function to check HID class devices capabilities, for now it provides a basic human readable text report (see the hid.core package, run it as main while HID class devices are connected to your system)

Feedback and Contributing

Feel free to contact me! use the main code project page, just tell what do you think about the project or bring me anything you think might be cool to consider.

Any participation it’s appreciated, feel free to contribute more examples or applications or just a reference to your open source project that uses the library.

Release changes

[Next release]

  • Fixed issue #33. Allow to read totally unparsed reports.


  • Issue #33.

  • PR #39. Intermittent lockup on close.


  • Patched ctypes issue on Python 3.5.1 64 bits.



  • Added PySide PnP example.


  • Working on python3.3 (broken on 0.3.5)


  • Win7/64 PnP example fixed again (due ctypes and Windows 64 API changes).


  • Jeff Rowberg (bluegiga) patch for deamon threads.


  • Win7/64 fixes, PnP example fixed, now using local encodings, stdout encodings now not in library (should be part of applications), UsagePage repr() fix.


  • Python 3 filtering fix


  • Python 2 and 3 support (tested with Python 3.2)


  • Refactored setup api handling.

  • Many PyLint fixes.


  • Fixed broken value array usages transactions

  • Better Setup API device paths handling

<= 0.2.8

  • Fixed broken value array usages transactions

  • Fixing sending output / feature reports

  • Fixed broken input report handling

  • Stability improvements

  • Tweaked PnP example, added frame closing event handler, so the USB device is closed

  • Report reading threads and device closing optimizations

  • Fixed bugs preventing properly setting report usage variables after a HidReport().get()

  • Fixed example

  • Fixed bug preventing proper value array setting/getting items

  • Fixed deadlock when device unplugged

  • Added HidDevice.set_raw_data_handler(), and corresponding example script

  • Fixing output only mode (no input report for forced open)

  • Bringing a little bit of stability

  • Output only mode (no reading thread configured)

  • Kind of usable now


  • First public release


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 (61.7 kB view hashes)

Uploaded Source

Supported by

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