Metadata-Version: 2.4
Name: imid
Version: 0.1.0
Summary: Deterministic MD5-based IDs for NumPy arrays
Project-URL: Homepage, https://github.com/phykn/imid
Project-URL: Repository, https://github.com/phykn/imid
Author-email: kn <phykn.kr@gmail.com>
License-Expression: MIT
Requires-Python: >=3.8
Requires-Dist: numpy
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

# imid

Deterministic MD5-based string IDs for NumPy arrays.

The hash incorporates **dtype**, **shape**, and **byte content**, so arrays differing in any of those produce different IDs.

## Install

```bash
pip install imid
```

## Usage

```python
import numpy as np
from imid import from_array

arr = np.array([1.0, 2.0, 3.0])

from_array(arr)                 # "a3f1b2c4"
from_array(arr, prefix="img_")  # "img_a3f1b2c4"
from_array(arr, length=16)      # "a3f1b2c4d5e6f7a8"
```

## API

### `from_array(arr, *, prefix="", length=8) -> str`

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `arr` | `np.ndarray` | *(required)* | Input array |
| `prefix` | `str` | `""` | String prepended to the ID |
| `length` | `int` | `8` | Length of the hex digest (max 32) |

- Non-contiguous arrays are handled automatically.
- Raises `ValueError` if `arr` is not a `numpy.ndarray`.

## Development

```bash
pip install -e ".[test]"
pytest
```

## License

MIT
