Metadata-Version: 2.4
Name: kura-rs
Version: 0.1.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Text Processing
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Typing :: Typed
Requires-Dist: pytest>=8 ; extra == 'test'
Requires-Dist: hypothesis>=6 ; extra == 'test'
Requires-Dist: datasketch==2.0.0 ; extra == 'test'
Requires-Dist: numpy==2.5.3 ; extra == 'test'
Provides-Extra: test
License-File: LICENSE-MIT
License-File: LICENSE-APACHE
Summary: Small, verified Rust parts for AI data processing and security, for Python.
Keywords: minhash,deduplication,rag,near-duplicate,rust
Author-email: Hinata Kurashina <h.kurashina49@gmail.com>
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/h-kurashina/kura
Project-URL: Repository, https://github.com/h-kurashina/kura

# kura-rs

Small, verified Rust parts for AI data processing and security, for Python.

Every part is checked against a reference implementation with differential tests and benchmarked across input sizes. See [the registry](https://github.com/h-kurashina/kura) for the evidence.

```sh
pip install kura-rs
```

## minhash

Near-duplicate detection with MinHash, **bit-for-bit compatible with `datasketch.MinHash`** (default scheme of datasketch 2.x). Same `num_perm`, `seed` and input give the same signature values.

```python
from kura_rs import minhash

hasher = minhash.MinHasher(num_perm=128, seed=1)  # datasketch's defaults

a = hasher.signature("the quick brown fox jumps".split())
b = hasher.signature("the quick brown fox leaps".split())
print(a.jaccard(b))

# Many documents at once (runs without holding the GIL)
sigs = hasher.signatures([doc.split() for doc in documents])
```

Items may be `bytes`, `bytearray` or `str` (encoded as UTF-8, same as `datasketch` with `.encode("utf-8")`).

## License

MIT OR Apache-2.0

