Rock-solid primitives for content-addressable hashing, chain fingerprinting, and config diffing
Project description
knurl
Rock-solid primitives for content-addressable hashing, chain fingerprinting, and config diffing.
Extracted from the SpiritEngine project.
Modules
- canon - Canonical JSON serialization (RFC 8785 inspired)
- hash - Content-addressable hashing
- chain - Merkle-like chain fingerprinting
- diverge - Divergence detection for fingerprint chains
- diff - JSON Patch (RFC 6902) diffs
- yield_ - Yield data serialization
Installation
pip install knurl
# With diff support (requires jsonpatch)
pip install knurl[diff]
Usage
from knurl import canon, hash, chain, diverge
# Canonical serialization
canonical_bytes = canon.serialize({"b": 1, "a": 2}) # b'{"a":2,"b":1}'
# Content-addressable hashing
content_hash = hash.compute("hello world") # 'sha256:...'
# Chain fingerprinting
fingerprints = chain.fingerprint([config1, config2, config3])
# Divergence detection
result = diverge.find(old_fingerprints, new_fingerprints)
Requirements
- Python 3.10+
- No dependencies (stdlib only)
- Optional:
jsonpatchfor diff module
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file knurl-0.1.0.tar.gz.
File metadata
- Download URL: knurl-0.1.0.tar.gz
- Upload date:
- Size: 94.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f163c8692aff98608cdfc8056535e1ff14e8a1a4f5404a851b57ef5e1fd55cba
|
|
| MD5 |
bc3bf19901fb339feb2cc1480eb7b2cd
|
|
| BLAKE2b-256 |
13e9d9ec35f1aa4c38a768e3bc43a5b177016947cd95486350d6154c887773fe
|
Provenance
The following attestation bundles were made for knurl-0.1.0.tar.gz:
Publisher:
publish.yml on spiritengine/knurl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
knurl-0.1.0.tar.gz -
Subject digest:
f163c8692aff98608cdfc8056535e1ff14e8a1a4f5404a851b57ef5e1fd55cba - Sigstore transparency entry: 1352647669
- Sigstore integration time:
-
Permalink:
spiritengine/knurl@04784671067162334fbd69f822b5d28899c3af8b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/spiritengine
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@04784671067162334fbd69f822b5d28899c3af8b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file knurl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: knurl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef9b5cd4606e240da6d77cdaa509050455753a34b3dc625e2ce8095b9a0d00df
|
|
| MD5 |
8f6c5a2435b003acf485589b8af24acb
|
|
| BLAKE2b-256 |
e8110c30640c7611201968be6ba639433ab997b9f48d34f953ee29f531129670
|
Provenance
The following attestation bundles were made for knurl-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on spiritengine/knurl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
knurl-0.1.0-py3-none-any.whl -
Subject digest:
ef9b5cd4606e240da6d77cdaa509050455753a34b3dc625e2ce8095b9a0d00df - Sigstore transparency entry: 1352647764
- Sigstore integration time:
-
Permalink:
spiritengine/knurl@04784671067162334fbd69f822b5d28899c3af8b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/spiritengine
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@04784671067162334fbd69f822b5d28899c3af8b -
Trigger Event:
workflow_dispatch
-
Statement type: