pyclickplc
Utilities for AutomationDirect CLICK PLCs: Modbus TCP client/server, address helpers, nickname CSV I/O, and DataView CDV I/O.
Downloads & Community Adoption
Health & Engineering Analysis (5 Pillars)
1. Governance & Community50 / 200 ▾
2. PEP Metadata & Packaging200 / 200 ▾
3. Security & Supply Chain200 / 200 ▾
4. Documentation, SEO & Ecosystem155 / 200 ▾
5. Engineering, CI & Quality200 / 200 ▾
Official Documentation & Usage Guide — pyclickplc
Show full original documentation (English README) ▾
pyclickplc
Talk to AutomationDirect CLICK PLCs from Python. Async Modbus TCP client and server, the CLICK address model, and readers and writers for CLICK's files: nickname CSV, DataView CDV, PLC data dumps and Project.ini.
It's the wire under pyrung and ClickNick, and it stands on its own as a Modbus client for any CLICK.
- Documentation: https://pyrung.com/pyclickplc/
- LLM docs index: https://pyrung.com/pyclickplc/llms.txt
- LLM full context: https://pyrung.com/pyclickplc/llms-full.txt
Install
uv add pyclickplc
# or
pip install pyclickplc
Requires Python 3.11+.
Quick example
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
values = await plc.addr.read("DF1-DF2") # {"DF1": 0.0, "DF2": 0.0}
asyncio.run(main())
The quickstart uses ClickServer to simulate a PLC locally, so you don't need hardware to try it.
What's included
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 nickname CSV and DataView CDV files and PLC data dumps as CLICK writes them, read installed modules and I/O assignments from a project's Project.ini, and read and set its PLC name.
Learn more
| 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 words |
| File I/O | Nickname CSV, DataView CDV, PLC data dumps, Project.ini |
| Examples | Runnable scripts |
Development
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 (zensical + mkdocstrings)
make docs-serve # Serve docs locally
make # Install, lint and test