# picotech/picosdk-python-wrappers architecture

> Architecture diagram of the GitHub repository picotech/picosdk-python-wrappers, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/picotech/picosdk-python-wrappers
- Repository: https://github.com/picotech/picosdk-python-wrappers
- Video tour (about a minute): https://gitdiagram.com/picotech/picosdk-python-wrappers/video

## Overview

PicoSDK Python wrappers let applications discover and control PicoScope/PicoLog hardware through vendor C drivers, with a higher-level Python device API and lower-level ctypes bindings. The main workflow is application → discovery/open → configure and capture → convert or process samples → use results. The repository also documents block, rapid-block, streaming, triggering, digital/MSO, and signal-generator examples, plus standalone Ethernet clients for select loggers. Driver-specific wiring is summarized because only a subset of source was sampled.

Main entry points: [`picosdk/ps4000a.py`](https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/ps4000a.py) (Driver bindings), [`ps5000aExamples/ps5000aRapidBlockExample.py`](https://github.com/picotech/picosdk-python-wrappers/blob/master/ps5000aExamples/ps5000aRapidBlockExample.py) (Block and rapid capture), [`picosdk/device.py`](https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/device.py) (Device API), [`picosdk/discover.py`](https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/discover.py) (Device discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Python API"]
  node_discovery["Device discovery<br/>[discover.py]"]
  node_device["Device API<br/>[device.py]"]
  node_library["Library base<br/>[library.py]"]
  node_functions["Conversions and checks<br/>[functions.py]"]
end

subgraph group_drivers["Driver Bindings"]
  node_bindings["Driver bindings<br/>[ps4000a.py]"]
  node_driverfamilies["Other device APIs"]
end

subgraph group_examples["Acquisition Examples"]
  node_capture["Block and rapid capture"]
  node_streaming["Streaming capture<br/>[streaming_mode.py]"]
  node_digital["Digital and MSO"]
  node_signalgen["Signal generation<br/>[ps4000aSigGen.py]"]
  node_plot["Example output"]
end

subgraph group_ethernet["Ethernet Clients"]
  node_etherclient["Direct Ethernet clients"]
end

node_user(("Python application"))
node_cdrivers["PicoSDK C drivers"]
node_hardware(("PicoScope / PicoLog"))
node_etherdevice(("Ethernet instruments"))

node_user -->|"requests devices"| node_discovery
node_discovery -->|"returns devices"| node_device
node_device -->|"uses API"| node_library
node_library -->|"loads driver calls"| node_bindings
node_bindings -->|"calls"| node_cdrivers
node_cdrivers -->|"controls"| node_hardware
node_user -->|"controls device"| node_device
node_capture -->|"configures and captures"| node_bindings
node_streaming -->|"streams samples"| node_driverfamilies
node_digital -->|"configures digital capture"| node_bindings
node_signalgen -->|"configures output"| node_bindings
node_capture -->|"converts and checks"| node_functions
node_capture -->|"plots results"| node_plot
node_user -->|"runs client"| node_etherclient
node_etherclient -->|"sends and receives UDP"| node_etherdevice

click node_discovery "https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/discover.py"
click node_device "https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/device.py"
click node_library "https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/library.py"
click node_functions "https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/functions.py"
click node_bindings "https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/ps4000a.py"
click node_driverfamilies "https://github.com/picotech/picosdk-python-wrappers/tree/master/picosdk"
click node_capture "https://github.com/picotech/picosdk-python-wrappers/blob/master/ps5000aExamples/ps5000aRapidBlockExample.py"
click node_streaming "https://github.com/picotech/picosdk-python-wrappers/blob/master/ps2000Examples/streaming_mode/streaming_mode.py"
click node_digital "https://github.com/picotech/picosdk-python-wrappers/blob/master/ps2000aExamples/ps2000aMSOBlockExample.py"
click node_signalgen "https://github.com/picotech/picosdk-python-wrappers/blob/master/ps4000aExamples/ps4000aSigGen.py"
click node_plot "https://github.com/picotech/picosdk-python-wrappers/blob/master/ps4000aExamples/ps4000aRapidBlockWaveformAveragingExample.py"
click node_etherclient "https://github.com/picotech/picosdk-python-wrappers/blob/master/pt104Examples/pt104DirectEthernet.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_discovery,node_device,node_library,node_functions toneBlue
class node_bindings,node_driverfamilies toneAmber
class node_capture,node_streaming,node_digital,node_signalgen,node_plot toneMint
class node_etherclient toneRose
class node_user,node_cdrivers,node_hardware,node_etherdevice toneIndigo
```

## Components

### Python API

- [Device discovery](https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/discover.py): `picosdk/discover.py`
- [Device API](https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/device.py): `picosdk/device.py`
- [Library base](https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/library.py): `picosdk/library.py`
- [Conversions and checks](https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/functions.py): `picosdk/functions.py`

### Driver Bindings

- [Driver bindings](https://github.com/picotech/picosdk-python-wrappers/blob/master/picosdk/ps4000a.py): `picosdk/ps4000a.py`
- [Other device APIs](https://github.com/picotech/picosdk-python-wrappers/tree/master/picosdk): `picosdk`

### Acquisition Examples

- [Block and rapid capture](https://github.com/picotech/picosdk-python-wrappers/blob/master/ps5000aExamples/ps5000aRapidBlockExample.py): `ps5000aExamples/ps5000aRapidBlockExample.py`
- [Streaming capture](https://github.com/picotech/picosdk-python-wrappers/blob/master/ps2000Examples/streaming_mode/streaming_mode.py): `ps2000Examples/streaming_mode/streaming_mode.py`
- [Digital and MSO](https://github.com/picotech/picosdk-python-wrappers/blob/master/ps2000aExamples/ps2000aMSOBlockExample.py): `ps2000aExamples/ps2000aMSOBlockExample.py`
- [Signal generation](https://github.com/picotech/picosdk-python-wrappers/blob/master/ps4000aExamples/ps4000aSigGen.py): `ps4000aExamples/ps4000aSigGen.py`
- [Example output](https://github.com/picotech/picosdk-python-wrappers/blob/master/ps4000aExamples/ps4000aRapidBlockWaveformAveragingExample.py): `ps4000aExamples/ps4000aRapidBlockWaveformAveragingExample.py`

### Ethernet Clients

- [Direct Ethernet clients](https://github.com/picotech/picosdk-python-wrappers/blob/master/pt104Examples/pt104DirectEthernet.py): `pt104Examples/pt104DirectEthernet.py`

### Other components

- **Python application**
- **PicoSDK C drivers**
- **PicoScope / PicoLog**
- **Ethernet instruments**

## Connections

- Python application → Device discovery: requests devices
- Device discovery → Device API: returns devices
- Device API → Library base: uses API
- Library base → Driver bindings: loads driver calls
- Driver bindings → PicoSDK C drivers: calls
- PicoSDK C drivers → PicoScope / PicoLog: controls
- Python application → Device API: controls device
- Block and rapid capture → Driver bindings: configures and captures
- Streaming capture → Other device APIs: streams samples
- Digital and MSO → Driver bindings: configures digital capture
- Signal generation → Driver bindings: configures output
- Block and rapid capture → Conversions and checks: converts and checks
- Block and rapid capture → Example output: plots results
- Python application → Direct Ethernet clients: runs client
- Direct Ethernet clients → Ethernet instruments: sends and receives UDP
