This release is a pre-release and may not be stable for production use.
GzipSimilarity
GzipSimilarity provides a dependency-light Swarmauri similarity implementation based on gzip compression and Normalized Compression Distance (NCD).
Features
- Implements
SimilarityBasefromswarmauri_base. - Compares text and binary values through shared gzip compressibility.
- Supports deterministic gzip sizing and configurable compression levels.
- Supports symmetric concatenation-order handling.
- Exposes both bounded similarity and raw NCD values.
Installation
uv add swarmauri_similarity_gzip
pip install swarmauri_similarity_gzip
Usage
from swarmauri_similarity_gzip import GzipSimilarity
similarity = GzipSimilarity()
score = similarity.similarity(
"The quick brown fox",
"Le renard brun rapide",
)
ncd = similarity.ncd(
"The quick brown fox",
"Le renard brun rapide",
)
similarity() returns a score in [0.0, 1.0], where higher values indicate greater shared compressibility. ncd() exposes the underlying Normalized Compression Distance. The result is a compression-based similarity estimate and should not be interpreted as semantic similarity without corpus-specific validation.
For language comparison, use balanced samples, consistent UTF-8 encoding and preprocessing, and sufficiently large inputs to reduce gzip framing effects.
The implementation is based on Benedetto, Caglioti, and Loreto, Language Trees and Zipping.
License
Apache-2.0
Metadata
Release files for swarmauri_similarity_gzip 0.1.0.dev5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swarmauri_similarity_gzip-0.1.0.dev5.tar.gz | 2.9 kB | Without provenance | Details for swarmauri_similarity_gzip-0.1.0.dev5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swarmauri_similarity_gzip-0.1.0.dev5-py3-none-any.whl | Python 3 | none | any | Details for swarmauri_similarity_gzip-0.1.0.dev5-py3-none-any.whl |
Total release size: 6.8 kB
Release files / swarmauri_similarity_gzip-0.1.0.dev5.tar.gz
| Download URL | swarmauri_similarity_gzip-0.1.0.dev5.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7abca537ba668496b305692208a790c438b8103c295786fe58ec4ddc9e370105
|
|
BLAKE2b-256 checksum How to use checksums |
fa843c2e01a395d861c548b49a8b21b30e36cf2e11edf0a38d070e914b5deb47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_similarity_gzip-0.1.0.dev5-py3-none-any.whl
| Download URL | swarmauri_similarity_gzip-0.1.0.dev5-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
694cfeb8a65bc921751573fc6e92bc900033c79e2c33902e4ce02ea8a47df0a9
|
|
BLAKE2b-256 checksum How to use checksums |
0c60198eece0538fcd12da33cfdcc5fbf637c8ea910b5558a72d33d0cf134f3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for swarmauri_similarity_gzip 0.1.0.dev5
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.