Skip to main content

link-rep

Parse, validate, and serialize TopLink composite-link representation documents.

Installation

pip install link-rep

Usage example

from link_rep import LinkRep

text = """K3a1: [[1,5,2,4],[3,1,4,6],[5,3,6,2]]
[K3a1, K3a1]
L[1, 1]#L[2, 1]
"""
rep = LinkRep()
rep.deserialize(text)
print(rep.serialize())
print(rep.json_serialize())

Algorithm

The parser separates four grammatical objects: comments, named PD-code definitions, the ordered factor set, and component-join terms. Each object has matching text and JSON serializers. Link identifiers are decomposed into mirror, knot/link, crossing, alternating, and table-index fields, which gives the rest of the toolchain a structured representation instead of ad-hoc string handling.

Input conventions

A PD code is represented as a list of four-entry crossings. Arc labels normally occur exactly twice. Public functions validate inputs and return new values rather than mutating caller-owned data unless their API explicitly says otherwise.

External software

No external software is required.

Development

Run examples and package checks before release. Python packages require Python 3.10 or newer. Build PyPI artifacts with:

poetry check
poetry build

License

MIT. See LICENSE.

Metadata

Release files for link-rep 0.0.5

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

Source distribution (sdist)

Source distribution for link-rep 0.0.5
File Size Uploaded Provenance Actions
link_rep-0.0.5.tar.gz 6.0 kB Without provenance Details for link_rep-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for link-rep 0.0.5
File Interpreter ABI Platform Actions
link_rep-0.0.5-py3-none-any.whl Python 3 none any Details for link_rep-0.0.5-py3-none-any.whl

Total release size: 17.0 kB

Security for link-rep 0.0.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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