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)
| File | Size | Uploaded | |
|---|---|---|---|
| link_rep-0.0.5.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| link_rep-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / link_rep-0.0.5.tar.gz
| Download URL | link_rep-0.0.5.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c7ef97c6a150baec979568f5f74a16dcd1f5cbab07e5d791275f7c1eacbbf8e
|
|
BLAKE2b-256 checksum How to use checksums |
6d6bd782ab8ce1afa16ff55a6a9d1ebea05030849faa0ffdb74184afc6982401
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Windows/10
|
Release files / link_rep-0.0.5-py3-none-any.whl
| Download URL | link_rep-0.0.5-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0fc6e10d89f0c618599966ae42dd4eaf870cb550ab218db06dda74cd4df24562
|
|
BLAKE2b-256 checksum How to use checksums |
6cdfe4f95e5657ebcf5112c793af82bd27c9d1e4f849f06a984d71c1f9a93b96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Windows/10
|