Skip to content

v0.2.0

Released 2026-03-06.

Record builders

New factory functions create AddressRecord and DataViewRecord from display addresses, with automatic normalization, data type inference, and default values:

from pyclickplc import make_address_record, make_dataview_record

record = make_address_record("DS1", nickname="TankTemp")
row = make_dataview_record("DS1", new_value=72)

Both types also gained concise __repr__ output that shows only populated fields.

Simpler file writes

write_csv and write_cdv now accept plain lists, so you don't need to construct wrapper objects for the common case:

from pyclickplc import make_address_record, make_dataview_record, write_cdv, write_csv

nicknames = [
    make_address_record("C1", nickname="RedLight"),
    make_address_record("C2", nickname="YellowLight"),
    make_address_record("TXT1", nickname="TrafficState"),
]
write_csv("nicknames.csv", nicknames)

write_cdv("dataview.cdv", [
    make_dataview_record(r.display_address) for r in nicknames
])
  • write_csv() accepts Iterable[AddressRecord] or Mapping[int, AddressRecord].
  • write_cdv() accepts Iterable[DataViewRecord] or DataViewFile (for full control over headers and row slots).

Documentation

  • README rewritten with a direct, code-first tone.
  • Guides restructured for progressive disclosure — start with the common case, add nuance later.
  • New Examples section with a traffic light simulator and PLC datetime sync script.
  • pyrung callout showing ladder-logic simulation as an alternative to Python-driven state machines.

Upgrading from v0.1

No breaking changes. Existing code using DataViewFile(rows=...) with write_cdv and Mapping with write_csv continues to work unchanged.