Metadata-Version: 2.4
Name: quipu-math
Version: 0.1.0
Summary: Mathematics of Incan knotted cord (quipu) data structures
Author: quipu-math contributors
License: MIT
Keywords: quipu,inca,knot,mathematics,encoding
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
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: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"

# quipu-math

Mathematics of Incan knotted cord (quipu) data structures.

Quipu are Incan knotted cord recording devices. This package implements the
**mathematics** of knotted data structures: encoding numbers as knot sequences,
building cord hierarchies, arithmetic on quipus, error detection via parity
knots, and SVG visualization.

## Installation

```bash
pip install quipu-math
```

## Quick Start

```python
from quipumath import encode_number, decode_knots, Cord, CordTree

# Encode a number as a knot sequence
knots = encode_number(247)   # [KnotType.long, KnotType.figure_eight, KnotType.long]

# Decode back
n = decode_knots(knots)      # 247

# Build a cord tree
tree = CordTree()
tree.add_pendant(Cord(color="red", knots=encode_number(100)))
tree.add_pendant(Cord(color="blue", knots=encode_number(47)))
```

## Modules

- **knot** — Knot types and number encoding/decoding
- **cord** — Cord and CordTree data structures with serialization
- **weave** — Categorical product of cords (weave/unweave)
- **checksum** — Incan-style error detection
- **visualize** — SVG rendering of cord trees
- **calculator** — Quipu arithmetic (add, subtract, multiply)

## License

MIT
