Skip to main content

laddercodec

The compatibility layer for CLICK ladder data. laddercodec reads and writes CLICK's native representations and enables reliable round-tripping between CLICK and the pyrung/ClickNick toolchain. Tested against captures from v2.60 through v4. Zero runtime dependencies.

It's the layer ClickNick pastes through, and it's useful on its own to convert between CLICK ladder data, Python objects, and CSV.

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: one Rung per rung on the clipboard
[rung] = decode(binary)
print(rung.logical_rows)
print(rung.instructions)

What's included

Encoder — encode() takes Rung objects or canonical CSV and produces clipboard binary ready to paste into Click. Supports all standard instruction types, including those new in CLICK v4, wire topologies, and styled comments.

Decoder — decode() reads clipboard binary back into structured Python objects (contacts, coils, timers, wires, comments). decode_program() reads ladder data from native CLICK program files. find_v4_only() lists the instructions an older CLICK would silently change.

Line check — check() reports the rungs CLICK's syntax check would reject or redraw, before you paste.

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

CLICK format reference — Technical reference for CLICK's native clipboard and program representations, including binary layouts and instruction records.

Status

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

Email, Home, PositionMove, and VelocityMove still intentionally surface as raw(...) passthroughs so clipboard and program data round-trips stay lossless while those families remain opaque.

Learn more

Encoding guide Encode, decode, and round-trip your first rung
Decoding guide Structured decode, program files, round-trip identity
CSV format 33-column canonical format, bundle layout, topology rules
Contributing Add instruction types, debug a failed paste
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                # install + lint + test

License

MPL-2.0

Metadata

Release files for laddercodec 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for laddercodec 0.5.0
File Size Uploaded Provenance Actions
laddercodec-0.5.0.tar.gz 3.2 MB With provenance Details for laddercodec-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for laddercodec 0.5.0
File Interpreter ABI Platform Actions
laddercodec-0.5.0-py3-none-any.whl Python 3 none any Details for laddercodec-0.5.0-py3-none-any.whl

Total release size: 3.6 MB

Release files / laddercodec-0.5.0.tar.gz

Download URL laddercodec-0.5.0.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
56662e4176fa13c40fc89107b795abc2dd6dca6b23d3044b61d7ead72ebba6f3
BLAKE2b-256 checksum
How to use checksums
ee89e501a4dc2e7be08a1d393081a72c1101ae62dff51344611855df4823b835
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / laddercodec-0.5.0-py3-none-any.whl

Download URL laddercodec-0.5.0-py3-none-any.whl
Size 383.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22452a03e717cfde569d77afd4accd4d82430b0805bb94ea97da442735063c3d
BLAKE2b-256 checksum
How to use checksums
93699f8d48d9e29976363ab5b642b6ff5ad9157a23c12dfa2b55840121233b2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for laddercodec 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for laddercodec-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page