PAIRL v1.5 reference implementation — parser, validator, canonicalizer, and renderer
Project description
pairl (Python)
Reference implementation of the PAIRL v1.5 protocol: parser, validator (rules V1–V12), canonicalizer + SHA-256 hashing, and a deterministic human-readable renderer. Pure standard library, no runtime dependencies.
Install
pip install -e impl/python # from the repo root
Library
import pairl
msg = pairl.parse(open("message.pairl").read())
res = pairl.validate(msg) # rules V1–V12
print(res.valid, res.errors, res.warnings)
print(pairl.compute_hash(msg)) # canonical SHA-256 (columnar-invariant)
print(pairl.render(msg)) # faithful human-readable rendering
Columnar blocks (#evid[claim,src,conf] + positional rows, §3.4) are parsed and
expanded to their canonical #type key=value records, so a message hashes
identically whether sent in columnar or key=value form (§9.4a).
CLI
python -m pairl validate [--strict] message.pairl
python -m pairl render message.pairl
python -m pairl hash message.pairl
python -m pairl canon message.pairl
Test
cd impl/python && python -m unittest discover -s tests
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 pairl-1.5.0.tar.gz.
File metadata
- Download URL: pairl-1.5.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c706c1dcf314089210e878d76bdeda0d9b0238ccd268d5088adb281236ff2d6
|
|
| MD5 |
df26c7449a667e965c67cc909742c233
|
|
| BLAKE2b-256 |
f585ec342a4fc34092ebadcbd230fde3c4ca26a8a7dc882b98d5f68278302b57
|
Provenance
The following attestation bundles were made for pairl-1.5.0.tar.gz:
Publisher:
release.yml on dwehrmann/PAIRL
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pairl-1.5.0.tar.gz -
Subject digest:
5c706c1dcf314089210e878d76bdeda0d9b0238ccd268d5088adb281236ff2d6 - Sigstore transparency entry: 1923707205
- Sigstore integration time:
-
Permalink:
dwehrmann/PAIRL@ab7f9563396cdbaf1b306e7bc78acc171b3d97e4 -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/dwehrmann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab7f9563396cdbaf1b306e7bc78acc171b3d97e4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pairl-1.5.0-py3-none-any.whl.
File metadata
- Download URL: pairl-1.5.0-py3-none-any.whl
- Upload date:
- Size: 15.3 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 |
11ddc3281cd3d07cd598d0f3c180a6aea584194284cfb5010b7d92267f7c9d5f
|
|
| MD5 |
1f874d5467123f8c579a5b7112c87202
|
|
| BLAKE2b-256 |
815f330f3bd58f92156fa84498efa7796b982925a6f56a9d858cfc5b9a8a3515
|
Provenance
The following attestation bundles were made for pairl-1.5.0-py3-none-any.whl:
Publisher:
release.yml on dwehrmann/PAIRL
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pairl-1.5.0-py3-none-any.whl -
Subject digest:
11ddc3281cd3d07cd598d0f3c180a6aea584194284cfb5010b7d92267f7c9d5f - Sigstore transparency entry: 1923707331
- Sigstore integration time:
-
Permalink:
dwehrmann/PAIRL@ab7f9563396cdbaf1b306e7bc78acc171b3d97e4 -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/dwehrmann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab7f9563396cdbaf1b306e7bc78acc171b3d97e4 -
Trigger Event:
push
-
Statement type: