Skip to main content

Binary codec for AutomationDirect CLICK PLC ladder clipboard format

Project description

laddercodec

Binary codec for AutomationDirect CLICK PLC ladder clipboard format. Encodes and decodes the native clipboard binary used by CLICK Programming Software. Tested against v2.60-v3.9x captures. Zero runtime dependencies.

Install

uv add laddercodec
# or
pip install laddercodec

Requires Python 3.11+.

Quick example

from laddercodec import read_csv, encode, decode

# CSV → binary (ready to paste into Click)
rungs = read_csv("my_rung.csv")
binary = encode(rungs[0])

# Binary → structured data
rung = decode(binary)
print(rung.logical_rows)
print(rung.instructions)

What's included

Encoderencode() takes Rung objects or canonical CSV and produces clipboard binary ready to paste into Click. Supports all standard instruction types, wire topologies, and styled comments.

Decoderdecode() reads clipboard binary back into structured Python objects (contacts, coils, timers, wires, comments). decode_program() reads Click's internal Scr*.tmp program files.

CSV I/Oread_csv() and write_csv() convert between the 33-column canonical CSV format and Rung objects. Multi-file program bundles supported.

Binary format docs — Byte-level reverse engineering of Click's clipboard and program file formats: buffer layout, cell grid, wire flags, instruction blobs, and multi-rung framing.

Status

laddercodec is beta for clipboard encode/decode, CSV I/O, and decode_program().

Email, Home, Position, and Velocity still intentionally surface as raw(...) passthroughs so binary and SCR round-trips stay lossless while those families remain opaque.

Learn more

Quickstart Encode, decode, and round-trip your first rung
Encoding guide Build rungs, wire tokens, instruction types, comments
Decoding guide Structured decode, program files, round-trip identity
CSV format 33-column canonical format, bundle layout, topology rules
Adding instructions Extend the codec with new instruction types
API reference Auto-generated from docstrings

Development

make install        # uv sync --all-extras --dev
make test           # pytest
make lint           # ruff + ty
make golden         # regenerate .bin from .csv fixtures
make docs-serve     # local docs dev server
make                # all of the above

License

MPL-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

laddercodec-0.1.1.tar.gz (354.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

laddercodec-0.1.1-py3-none-any.whl (122.6 kB view details)

Uploaded Python 3

File details

Details for the file laddercodec-0.1.1.tar.gz.

File metadata

  • Download URL: laddercodec-0.1.1.tar.gz
  • Upload date:
  • Size: 354.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for laddercodec-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3ddda911cc64592a48f291eb611a9ac32c8606e3d64b34c3159926baa26da2b1
MD5 9aa11132697abeda7c2c87a5f0dcf369
BLAKE2b-256 c6798acbd7dc043f4f5720ca0e100f7c84f168297bf240ed56ed6d9d31f6d6d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for laddercodec-0.1.1.tar.gz:

Publisher: publish.yml on ssweber/laddercodec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file laddercodec-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: laddercodec-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 122.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for laddercodec-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2688b1f63ea17f3352693f0515ced8989da339007226c8d76acc05b5303e2a65
MD5 6dc9a8ad38e1c3a956e6c53a4328c0c9
BLAKE2b-256 00f22fc850ca28090729b6669a2143f9c172c243a9abab31d61046739f7ebefd

See more details on using hashes here.

Provenance

The following attestation bundles were made for laddercodec-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ssweber/laddercodec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page