Metadata-Version: 2.4
Name: pyvq
Version: 0.1.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
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: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
License-File: LICENSE
Summary: Python bindings for the Vq library
Keywords: vector-quantization,quantization,nearest-neighbor,data-compression,embeddings
Author-email: Hassan Abedi <hassan.abedi.t@gmail.com>
Maintainer-email: Hassan Abedi <hassan.abedi.t@gmail.com>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: documentation, https://github.com/CogitatorTech/vq
Project-URL: homepage, https://github.com/CogitatorTech/vq
Project-URL: repository, https://github.com/CogitatorTech/vq

## PyVq

[![Python version](https://img.shields.io/badge/python-%3E=3.10-3776ab?style=flat&labelColor=282c34&logo=python)](https://github.com/CogitatorTech/vq)
[![PyPI version](https://img.shields.io/pypi/v/pyvq?style=flat&labelColor=282c34&color=3775a9&logo=pypi)](https://badge.fury.io/py/pyvq)
[![Documentation](https://img.shields.io/badge/docs-read-00acc1?style=flat&labelColor=282c34&logo=readthedocs)](https://CogitatorTech.github.io/vq/python)
[![License: MIT](https://img.shields.io/badge/license-MIT-0288d1?style=flat&labelColor=282c34&logo=open-source-initiative)](LICENSE)

PyVq provides Python bindings for [Vq](https://github.com/CogitatorTech/vq) vector quantization library.

### Installation

```bash
pip install pyvq
```

### Quickstart

```python
import numpy as np
import pyvq

# Binary quantization
bq = pyvq.BinaryQuantizer(threshold=0.0, low=0, high=1)
vector = np.array([-0.5, 0.0, 0.5, 1.0], dtype=np.float32)
codes = bq.quantize(vector)
print(f"Binary codes: {codes}")  # [0, 1, 1, 1]

# Scalar quantization  
sq = pyvq.ScalarQuantizer(min=-1.0, max=1.0, levels=256)
quantized = sq.quantize(vector)
reconstructed = sq.dequantize(quantized)
print(f"Reconstructed: {reconstructed}")

# Distance computation
dist = pyvq.Distance.euclidean()
a = np.array([1.0, 2.0, 3.0], dtype=np.float32)
b = np.array([4.0, 5.0, 6.0], dtype=np.float32)
print(f"Distance: {dist.compute(a, b)}")

# Check the SIMD backend in use
print(f"SIMD Backend: {pyvq.get_simd_backend()}")
```

### Documentation

Visit PyVq's [documentation page](https://CogitatorTech.github.io/vq/python) for more information including examples and API references.

### License

PyVq is licensed under the [MIT License](LICENSE).

