Metadata-Version: 2.4
Name: link-rep-to-pd-code
Version: 0.1.1
Summary: given a link-rep, output its pd_code for the composite link or knot.
License: MIT
License-File: LICENSE
Author: GGN_2015
Author-email: neko@jlulug.org
Requires-Python: >=3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: link-rep (>=0.0.4)
Requires-Dist: pd-code-components (>=0.1.0)
Requires-Dist: pd-code-connected-sum (>=0.1.0)
Requires-Dist: pd-code-sanity (>=0.1.0)
Description-Content-Type: text/markdown

# link-rep-to-pd-code

Evaluate a textual link representation as one canonically numbered PD code.

## Installation

```bash
pip install link-rep-to-pd-code
```

## Usage example

```python
from link_rep_to_pd_code import link_rep_to_pd_code

text = """K3a1: [[1,5,2,4],[3,1,4,6],[5,3,6,2]]
[K3a1, K3a1]
L[1, 1]#L[2, 1]
"""
pd = link_rep_to_pd_code(text)
print(pd)
```

## Algorithm

The parser resolves every factor name to its PD definition and records a representative label for every original component. Join terms are processed in order. Each oriented connected sum returns old-to-new label maps; those maps update every representative in both merged clusters, including factors merged earlier. The final PD code is topologically normalized, sorted, and relabelled contiguously.

## 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:

```bash
poetry check
poetry build
```

## License

MIT. See `LICENSE`.

