PyUSB is a python module that interfaces to Future Technology
Devices (FTDI) D2XX drivers.
FTDI USB chips are used in a variety of USB devices such as USB
converters and dongles.
Currently, PyUSB has been tested under MS Windows.
PyUSB is distributed under the GNU
Lesser General Public License (LGPL).
It is maintained by Pablo Bleyer Kocik.
Please email me if you have any questions or if you have found a bug.
If you are looking for a way to use the D2XX driver with Java, you can try
the jd2xx package.
- PyUSB 1.6 supports the new FTDI high speed devices.
- PyUSB 1.5 eeProgram method now accepts a dict object as input instead of keyword arguments.
Please use the source and
FTDI's FTD2XX Programmers Guide.
The PyUSB API follows similar guidelines as the D2XX driver,
however the behavior has been modified where necessary to fit the
Python programming style.
# import the PyUSB module
# list devices by description, returns tuple of attached devices description strings
d = d2xx.listDevices(d2xx.OPEN_BY_DESCRIPTION)
# list devices by serial, returns tuple of attached devices serial strings
d = d2xx.listDevices() # implicit d2xx.OPEN_BY_SERIAL_NUMBER
h = d2xx.open(0)
# read eeprom
# get queue status
# set RX/TX timeouts
# write bytes (serial mode)
print h.write('Hello world!\r\n")
# read bytes (serial mode)
No Win32 API compatibility layer functions will be provided. It is better to open a
device and pass the handle to the Python for Windows
The D2XX library is Copyright ©2001-2004 Future Technology Devices International Ltd.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.