Skip to main content

imid

Deterministic MD5-based string IDs for NumPy arrays.

The hash incorporates dtype, shape, and byte content, so differences in any of those affect the ID.

Install

pip install imid

Usage

import numpy as np
from imid import get_id

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

get_id(arr)                 # "70543f9b"
get_id(arr, prefix="img_")  # "img_70543f9b"
get_id(arr, length=16)      # "70543f9b270d20db"

API

get_id(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 (1-32)
  • Non-contiguous arrays are handled automatically.
  • Raises TypeError if arr is not a numpy.ndarray or length is not an int.
  • Raises ValueError if length is outside 1-32 (inclusive).

Development

python -m pip install -e ".[test]"
python -m pytest

License

MIT

Metadata

Release files for imid 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imid 0.2.4
File Size Uploaded Provenance Actions
imid-0.2.4.tar.gz 2.2 kB Without provenance Details for imid-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for imid 0.2.4
File Interpreter ABI Platform Actions
imid-0.2.4-py3-none-any.whl Python 3 none any Details for imid-0.2.4-py3-none-any.whl

Total release size: 4.3 kB

Release files / imid-0.2.4.tar.gz

Download URL imid-0.2.4.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9f619841a2c2a2e9e40fff8ea9d7db83615eee89d116836c9c582a0d61c4643f
BLAKE2b-256 checksum
How to use checksums
dfce2852e618f07b105b9d7d6db7a6f30a18f8d67d157f76c91d65da0f27f7bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / imid-0.2.4-py3-none-any.whl

Download URL imid-0.2.4-py3-none-any.whl
Size 2.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b689ed405e463e742c5a5d3b5b28ef133aeb9634020a98f8ec16362e3e69013c
BLAKE2b-256 checksum
How to use checksums
c6d88c506ade5341988aae35294dfb8043f06a0223c9400a4d0a7673ab980dff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for imid 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page