Skip to main content

PyD3XX

An unofficial Python wrapper for the FTDI D3XX library.
PyD3XX supports Windows, Linux, and MacOS.
All D3XX dynamic library variants are included in this package, so you don't need to include them directly in your project!
^You don't need and should not have any D3XX .dll, .dylib, or .so file in your script's directory.
This was designed so the user needs zero ctypes knowledge and not need to import anything besides PyD3XX to interact with D3XX (FT600 & FT601) devices. The user should never have to interact with a ctypes object or method.

Plans

  1. Fix segfault on program exit when on Linux or MacOS.
  2. Add a FT602 sub module in the future.

API - Classes

Here are the class equivalents for the D3XX structures and unique Python classes for this wrapper.

All D3XX Structure equivalents have variants of their variables with a "_". These are usually a ctypes equivalent of the variable but are NOT directly used in the Python function calls except "_Handle" in the FT_Device class. YOU SHOULD IGNORE THE "_" variants unless you know what you're doing.

All D3XX Structure equivalent classes have every variable accessible that the original structure has. The variables will have the same name as in the programming guide unless otherwise stated here.

If a class/structure's field/variable is not mentioned, it is an integer.

API - Classes - D3XX Structure Equivalents

FT_Device == FT_DEVICE_LIST_INFO_NODE

FT_Device should be passed into function calls and not FT_Device.Handle or FT_Device._Handle. Those just exist for your reference.
Handle (int)
Flags (int)
Type (int)
ID (int)
LocID (int)
SerialNumber (str)
Description (str)

FT_DeviceDescriptor == FT_DEVICE_DESCRIPTOR
FT_ConfigurationDescriptor == FT_CONFIGURATION_DESCRIPTOR
FT_InterfaceDescriptor == FT_DEVICE_DESCRIPTOR
FT_StringDescriptor == FT_STRING_DESCRIPTOR

szString (str)

FT_Pipe == FT_PIPE_INFORMATION
FT_Overlapped == OVERLAPPED
FT_Pipe == FT_PIPE_INFORMATION
FT_SetupPacket == FT_SETUP_PACKET

FT_60XCONFIGURATION == FT_60XCONFIGURATION

StringDescriptors (A list of str objects in the "utf_16_le" format).

API - Classes - Python Specific

FT_Buffer | Used as a buffer for function calls.

from_int() - Creates an FT_Buffer from an integer.
from_str() - Creates an FT_Buffer from a string.
from_bytearray() - Creates an FT_Buffer from a bytearray.
from_bytes() - Creates an FT_Buffer from bytes.
Value() - Returns a bytearray of the FT_Buffer.

API - Functions

FT_CreateDeviceInfoList() -> Status (int), DeviceCount (int):

FT_CreateDeviceInfoList() -> Status (int), DeviceCount (int):

FT_GetDeviceInfoList(DeviceCount: int) -> Status (int), DeviceList (list[FT_Device]):

FT_GetDeviceInfoDetail(Index: int) -> Status (int), Device (FT_Device):

FT_ListDevices(IndexCount: int, Flags: int) -> Status (int), Information (int | str | list[str]):

IndexCount = Index or Device Count

FT_Create(Identifier, OpenFlag: int, Device: FT_Device) -> Status (int):

FT_Close(Device: FT_Device) -> Status (int):

FT_WritePipe(Device: FT_Device, Pipe: FT_Pipe, Buffer: FT_Buffer, BufferLength: int, Overlapped) -> Status (int), BytesTransferred(int):

Overlapped = FT_Overlapped or int(0) or NULL

FT_WritePipeEx(Device: FT_Device, Pipe: FT_Pipe, Buffer: FT_Buffer, BufferLength: int, Overlapped) -> Status (int), BytesTransferred(int):

FT_ReadPipe(Device: FT_Device, Pipe: FT_Pipe, BufferLength: int, Overlapped) -> Status (int), Buffer (FT_Buffer), BytesTransferred (int):

FT_ReadPipeEx(Device: FT_Device, Pipe: FT_Pipe, BufferLength: int, Overlapped) -> Status (int), Buffer (FT_Buffer), BytesTransferred (int):

FT_GetOverlappedResult(Device: FT_Device, Overlapped: FT_Overlapped, Wait: bool) -> Status (int), LengthTransferred (int):

FT_InitializeOverlapped(Device: FT_Device) -> Status (int), Overlapped (FT_Overlapped):

Create an overlapped object.

FT_ReleaseOverlapped(Device: FT_Device, Overlapped: FT_Overlapped) -> Status (int):

FT_SetStreamPipe(Device: FT_Device, AllWritePipes: bool, AllReadPipes: bool, Pipe: FT_Pipe | int, StreamSize: int) -> Status (int):

FT_ClearStreamPipe(Device: FT_Device, AllWritePipes: bool, AllReadPipes: bool, Pipe: FT_Pipe | int) -> Status (int):

FT_SetPipeTimeout(Device: FT_Device, Pipe: FT_Pipe, Timeout: int) -> Status (int):

FT_GetPipeTimeout(Device: FT_Device, Pipe: FT_Pipe) -> Status (int), Timeout (int):

FT_AbortPipe(Device: FT_Device, Pipe: FT_Pipe) -> Status (int):

FT_GetDeviceDescriptor(Device: FT_Device) -> Status (int), DeviceDescriptor (FT_DeviceDescriptor):

FT_GetConfigurationDescriptor(Device: FT_Device) -> Status (int), ConfigurationDescriptor (FT_ConfigurationDescriptor):

FT_GetInterfaceDescriptor(Device: FT_Device, InterfaceIndex) -> Status (int), InterfaceDescriptor (FT_InterfaceDescriptor):

FT_GetPipeInformation(Device: FT_Device, InterfaceIndex: int, PipeIndex: int) -> Status (int), Pipe (FT_Pipe):

FT_GetDescriptor(Device: FT_Device, DescriptorType: int, Index: int) -> Status (int), Descriptor (FT_DeviceDescriptor | FT_InterfaceDescriptor | FT_ConfigurationDescriptor | FT_StringDescriptor), LengthTransferred (int):

FT_ControlTransfer(Device: FT_Device, SetupPacket: FT_SetupPacket, Buffer: FT_Buffer, BufferLength: int) -> Status (int), LengthTransferred (int):

FT_GetVIDPID(Device: FT_Device) -> Status (int), VID (int), PID (int):

FT_EnableGPIO(Device: FT_Device, EnableMask: int, DirectionMask: int) -> Status (int):

FT_WriteGPIO(Device: FT_Device, SelectMask: int, Data: int) -> Status (int):

FT_ReadGPIO(Device: FT_Device) -> Status (int), GPIO_Data (int):

FT_SetGPIOPull(Device: FT_Device, SelectMask: int, PullMask: int) -> Status (int):

FT_SetNotificationCallback(Device: FT_Device, CallbackFunction: typing.Callable[[int, int, int], None]) -> Status (int):

FT_ClearNotificationCallback(Device: FT_Device) -> Status (int):

FT_GetChipConfiguration(Device: FT_Device) -> Status (int), Configuration (FT_60XCONFIGURATION):

FT_SetChipConfiguration(Device: FT_Device, Configuration: FT_60XCONFIGURATION) -> Status (int):

FT_IsDevicePath(Device: FT_Device, DevicePath: str) -> Status (int):

FT_GetDriverVersion(Device: FT_Device) -> Status (int), Version (int):

FT_GetLibraryVersion() -> Status (int), Version (int):

FT_CycleDevicePort(Device: FT_Device) -> Status (int):

FT_SetSuspendTimeout(Device: FT_Device, Timeout: int) -> Status (int):

FT_GetSuspendTimeout(Device: FT_Device) -> Status (int), Timeout (int):

FT_GetStringDescriptor(Device: FT_Device, StringIndex: int) -> Status (int), String Descriptor (FT_StringDescriptor):

FT_ReadPipeAsync(Device: FT_Device, FIFO_Index: int, BufferLength: int, Overlapped) -> Status (int), Buffer (FT_Buffer), BytesTransferred (int):

FT_WritePipeAsync(Device: FT_Device, FIFO_Index, Buffer: FT_Buffer, BufferLength: int, Overlapped) -> Status (int), BytesTransferred (int):

Metadata

Release files for PyD3XX 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyD3XX 1.0.1
File Size Uploaded Provenance Actions
pyd3xx-1.0.1.tar.gz 1.9 MB Without provenance Details for pyd3xx-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PyD3XX 1.0.1
File Interpreter ABI Platform Actions
pyd3xx-1.0.1-py3-none-any.whl Python 3 none any Details for pyd3xx-1.0.1-py3-none-any.whl

Total release size: 3.8 MB

Release files / pyd3xx-1.0.1.tar.gz

Download URL pyd3xx-1.0.1.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
b7b0fa4f950a0cbdce833efc5ba8af8c24874f42ba2037b26d79574c262e9992
BLAKE2b-256 checksum
How to use checksums
6a4ff8ff0a35dc68422e64414a5dc98a74410507c8c28f9e4b75c1628f1f6dfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / pyd3xx-1.0.1-py3-none-any.whl

Download URL pyd3xx-1.0.1-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
75d0cb8944a04a2ed5e712f4914343c717820f7e8e1d49a807267d593f08d345
BLAKE2b-256 checksum
How to use checksums
069e22099ab8a4cb21ee6595e2d6fab16eb942b5ccf7a68978fbf2ee5d4e22be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for PyD3XX 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page