v0.1.0 — Write ladder logic in Python
Summary
Write ladder logic in Python. Simulate it. Test it. Deploy it.
pyrung turns Python's with block into a ladder rung — condition on the rail, instructions in the body. It targets
AutomationDirect CLICK PLCs and ProductivityOpen P1AM-200 controllers.
251 commits from placeholder to here.
What's in the box
-
Core engine — Immutable scan cycle, coils, latches, timers, counters, branching, subroutines, structured tags,
edge detection. Puref(state) → new_state. Built to match real Click behavior — overflow, truncation, accumulation,
all of it. -
Click PLC dialect — Tag-to-address mapping, memory bank validation, nickname file export. Soft PLC mode: run
behind a Click-compatible Modbus interface for integration testing. Two pyrung programs can talk to each other. -
CircuitPython dialect — Generates a self-contained scan loop for P1AM-200 hardware from any pyrung program.
-
VS Code debugger — Step through scans, set breakpoints on rungs, force tags, diff states, time-travel through
history. -
1,600+ tests across core, Click, CircuitPython, and DAP.
What it's for
Click PLCs have no simulator. Write your logic in Python, test it with pytest, then transpose to Click. Or skip the
hardware — run as a soft PLC over Modbus, or generate CircuitPython for a P1AM-200.
Status
This is v0.1.0. The engine works and is well-tested, but the public API is not yet frozen. Expect changes before 1.0.