Skip to main content

A package that simplifies USB/HID communications on windows

Project description

Introduction

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.

Advantages

  • 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…)

  • Not so fast top level interfacing. But you could still access, directly your raw data reports.

Installation Instructions

Windows

The most convenient way of installing is using easy_install or pip, I recomend 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 setup.py install command line is sufficient, setuptools or distribute (for python 3) are required.

Other

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.

Gernal purpose instructions can be found on the main project code page.

Utilities

More on this later…

  • The module pywinusb.hid.tools 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, if you are willing to contribute but don’t have any ideas or spare time, feel free to donate.

Release changes

0.3.1

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

0.3.0

  • Refactored setup api handling.

  • Many PyLint fixes.

0.2.9

  • Fixed broken value array usages transactions

  • Better Setup API device paths handling

0.2.8

  • Fixed broken value array usages transactions

0.2.7

  • Fixing sending output / feature reports

0.2.6

  • Fixed broken input report handling

  • Stability improvements

0.2.5

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

  • Report reading threads and device closing optimizations

0.2.4

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

  • Fixed raw_data.py example

  • Fixed bug preventing proper value array setting/getting items

  • Fixed deadlock when device unplugged

0.2.3

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

0.2.2

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

0.2.1

  • Bringing a little bit of stability

  • Output only mode (no reading thread configured)

  • Kind of usable now

0.1.0

  • First public release

nn

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

pywinusb-0.3.1.zip (53.7 kB view details)

Uploaded Source

File details

Details for the file pywinusb-0.3.1.zip.

File metadata

  • Download URL: pywinusb-0.3.1.zip
  • Upload date:
  • Size: 53.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pywinusb-0.3.1.zip
Algorithm Hash digest
SHA256 13ab554c5fde764fb5f746d50808d4ce1816dddc15f7a329232b5c11f3aa46c8
MD5 2005d57d04c17b2a62f7025c9550bfd5
BLAKE2b-256 f4a3e06bdf871f4ca9617ff4a5e5cd1be5eea93cec2b0518ebeaac59134a1b9c

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