Skip to main content

unidpp-py

The UniDPP Python library — the semantics mirror and conformance tooling. Part of UniDPP (github.com/unidpp). License: MIT.

Pure stdlib (no runtime dependencies). The package mirrors the Rust/TypeScript core so the semantics have a second, independent statement:

  • unidpp.model — the mirrored model (documents, findings, verdicts);
  • unidpp.eventlog — the commitment-chained event log;
  • unidpp.verify — the verification-pipeline harness (the I13 degradation ladder + I9 verdicts; stdlib hmac/hashlib replace WebCrypto, ECDSA is a deliberate unsupported-slot placeholder per the multi-suite degrade model);
  • unidpp.canonical — canonical JSON (RFC 8785-lite);
  • unidpp.adapters — protocol adapters: untp (UNTP verifiable credentials), en18223 (the EN 18223 document validator + EU-profile runner), epcis;
  • unidpp.temporal — the DPP temporal profile;
  • unidpp.carrier — QR carrier-budget conformance;
  • unidpp.conformance — the conformance runner.

Conformance

The conformance runner proves the validators catch real defects, not synthetic strawmen. CHECK_REGISTRY carries the check classes:

check what it proves
positive-corpus the ported TS fixtures (laptop, car) validate against the wire schemas and their chains verify
audit-negative the AUDIT A1–A6 corpus defects (found in EN 18223's own examples) fail with precise findings
temporal-conformance every timestamp field conforms to the DPP temporal profile (ISO 8601-1:2019 incl. Amd 1:2022 disambiguation)
carrier-budget serialized payload sizes fit their declared carrier class (ISO/IEC 18004 QR capacity tables, ported from the CLI)
python -m unidpp.conformance --out reports/

The temporal profile (unidpp.temporal) validates every timestamp field with a distinct finding code — separator typography (T1, the en-dash the EN's own Annex B prints), extended-format and precision rules, calendar ranges, the 24:00:00 end-of-day form, timezone discipline, and the decimal sign:

>>> from unidpp.temporal import validate_timestamp
>>> validate_timestamp("2025–08–22T03:12:00Z", "lastUpdated").code
'T1-separator-typography'
>>> validate_timestamp("2025-08-22T03:12:00Z", "lastUpdated") is None
True

The carrier budget (unidpp.carrier) measures the canonical serialized size of a payload against the ported ISO/IEC 18004 QR byte-capacity tables; a payload that exceeds its declared class is flagged with the computed size versus the capacity — never silently truncated:

>>> from unidpp.carrier import measure
>>> m = measure({"a": "x" * 380}, declared="qr-v15-M")
>>> (m.size_bytes, m.fits_declared)
(388, True)

Two report suites build on the runner (scripts/):

  • EU profile (eu_profile_report.py) — the full EN 18223:2026 example corpus through the validators. The corpus itself is an extraction from licensed sources and is deliberately not distributed with the repository (gitignored); the suite runs where the corpus is present and its findings are published as conformance/eu-profile/REPORT.md.
  • Competitor register (competitor_report.py) — the published artifacts of the open-source DPP implementations (freeDPP live endpoints, open-dpp's e2e fixture) through the same pipeline, with verbatim source citations; findings in conformance/competitors/REPORT.md.

Build & test

pip install -e ".[test]"
pytest

The suite covers the model, event log, verification ladder, adapters (UNTP round-trip, EN 18223 projection), the conformance checks (temporal, carrier, corpus), and the competitor register. The EU-profile corpus tests skip automatically when the licensed extraction is not present.

Releasing

Releases are version tags: a pushed v* tag runs .github/workflows/publish.yml, which builds the sdist and wheel and uploads them to PyPI through PyPI trusted publishing. Trusted publishing needs a one-time link on pypi.org: under the project's publishing settings, add this repository and the publish workflow as a trusted publisher. The first publication of 0.1.0 was made by the owner from a maintainer machine, before trusted publishing was linked.

Metadata

Release files for unidpp 0.1.1

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

Source distribution (sdist)

Source distribution for unidpp 0.1.1
File Size Uploaded Provenance Actions
unidpp-0.1.1.tar.gz 104.7 kB Without provenance Details for unidpp-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 192.0 kB

Release files / unidpp-0.1.1.tar.gz

Download URL unidpp-0.1.1.tar.gz
Size 104.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5926390f4cf5ca9e829a9b866be1df1de92305c849b56b0299893067eadbeb69
BLAKE2b-256 checksum
How to use checksums
5723a93af7849336f0cddbd3a2301b2a1f4ec5998e2a183ac6f82dfd8e6f8f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / unidpp-0.1.1-py3-none-any.whl

Download URL unidpp-0.1.1-py3-none-any.whl
Size 87.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2f0cf05a3364a6210a71aeaab28a90b107756884d4fca0862053a40c31bfd2c
BLAKE2b-256 checksum
How to use checksums
2252e61cffe8a353a257ff7911eadcb549430d51c98522f02fda6bb12da7d47b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Security for unidpp 0.1.1

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