A Python library for validating Digital Product Passports (DPP) according to EU ESPR regulations and UNTP standards.
- :octicons-check-circle-16:{ .text-green } Seven-Layer Validation — Schema, Model, Semantic, JSON-LD, Vocabulary, Plugin, and Signature validation
- :octicons-package-16: UNTP DPP Schema Support — Both 0.6.x
and 0.7.0 (default) wire formats; auto-detected from
@context/$schemaURLs. See UNTP DPP versions. - :octicons-arrow-switch-16: Compat shim 0.6 → 0.7 —
dppvalidator migrateupgrades v0.6.x payloads to v0.7.0 shape with structured warnings. See the migration guide. - :octicons-rocket-16: High Performance — 80,000+ validations per second
- :octicons-plug-16: Plugin System — Extensible with custom
validators and exporters; version-aware rules with
applies_to_versionsopt-in. - :octicons-file-code-16: JSON-LD Export — W3C Verifiable Credentials compliant output
- :octicons-terminal-16: CLI & API — Use from command line or programmatically
=== "uv (recommended)"
```
uv add dppvalidator
```
=== "pip"
```
pip install dppvalidator
```
from dppvalidator.validators import ValidationEngine
engine = ValidationEngine()
result = engine.validate(
{
"id": "https://example.com/dpp/12345",
"issuer": {"id": "https://example.com/issuer", "name": "Acme Corp"},
}
)
if result.valid:
print("DPP is valid!")
else:
for error in result.errors:
print(f"{error.path}: {error.message}")# Validate a DPP JSON file (auto-detects version from the payload)
dppvalidator validate passport.json
# Pin a specific UNTP version
dppvalidator validate passport.json --schema-version 0.7.0
# Upgrade a v0.6.x payload to v0.7.0 shape
dppvalidator migrate passport.json -o passport-v07.json
# Validate-after-upgrade in one shot
dppvalidator validate passport.json --upgrade-from 0.6.1 --schema-version 0.7.0
# Export to JSON-LD
dppvalidator export passport.json --format jsonld
# List every registered UNTP version
dppvalidator schema list- Installation Guide — Detailed installation instructions
- Quick Start Tutorial — Get started in 5 minutes
- CLI Usage — Command line reference
- Validation Guide — Understanding validation layers
- UNTP DPP versions — Version handling, detection, defaults, adding a new version
- Migration guide: 0.6.x → 0.7.0 — The compat shim, field rename table, warning codes
- API Reference — Full API documentation
- llms.txt — Quick context for LLMs
- llms-ctx.txt — Extended context with API details
We welcome contributions! See our Contributing Guide to get started.
MIT License - see LICENSE for details.