Talk to AutomationDirect CLICK PLCs from Python. Async Modbus TCP client/server, address helpers, nickname CSV and DataView CDV file I/O.
- Documentation: https://ssweber.github.io/pyclickplc/
- LLM docs index: https://ssweber.github.io/pyclickplc/llms.txt
- LLM full context: https://ssweber.github.io/pyclickplc/llms-full.txt
uv add pyclickplc
# or
pip install pyclickplcRequires Python 3.11+.
import asyncio
from pyclickplc import ClickClient
async def main():
async with ClickClient("192.168.1.10", 502) as plc:
# Read and write registers with native Python types
await plc.ds.write(1, 100)
ds1 = await plc.ds[1] # int
await plc.y.write(1, True) # bool
df1 = await plc.addr.read("DF1") # float
asyncio.run(main())No PLC on hand? The quickstart uses ClickServer to simulate one locally.
Modbus client — ClickClient reads and writes PLC values as native Python types (bool, int, float, str). Access by bank (plc.ds), by address string (plc.addr), or by tag name (plc.tag).
Modbus service — ModbusService wraps the async client for sync and UI applications with background polling and auto-reconnect.
Modbus server — ClickServer simulates a CLICK PLC over Modbus TCP. Use it for development and testing without hardware.
File I/O — Read and write CLICK nickname CSV and DataView CDV files. Compatible with CLICK programming software and ClickNick.
| Quickstart | Connect, read/write, simulate a traffic light |
| Client guide | Bank accessors, address strings, tags |
| Types & values | Native Python types per bank family |
| Addressing | Normalization, sparse X/Y, XD/YD display indexing |
| File I/O | Nickname CSV and DataView CDV |
| Examples | Runnable scripts |
uv sync --all-extras --dev # Install dependencies
make test # Run tests (uv run pytest)
make lint # Lint (codespell, ruff, ty)
make docs-build # Build docs (mkdocs + mkdocstrings)
make docs-serve # Serve docs locally
make # All of the above