Validate EU Digital Product Passports with Python - 80k ops/sec.¶
dppvalidator¶
A Python library for validating Digital Product Passports (DPP) according to EU ESPR regulations and UNTP standards.
Features¶
- Seven-Layer Validation — Schema, Model, Semantic, JSON-LD, Vocabulary, Plugin, and Signature validation
- UNTP DPP Schema Support — Built-in support for UNTP DPP 0.6.1
- High Performance — 80,000+ validations per second
- Plugin System — Extensible with custom validators and exporters
- JSON-LD Export — W3C Verifiable Credentials compliant output
- CLI & API — Use from command line or programmatically
Quick Install¶
Quick Start¶
Validate a DPP file¶
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}")
Command Line¶
# Validate a DPP JSON file
dppvalidator validate passport.json
# Export to JSON-LD
dppvalidator export passport.json --format jsonld
# Show schema information
dppvalidator schema --version 0.6.1
Documentation¶
- Installation Guide — Detailed installation instructions
- Quick Start Tutorial — Get started in 5 minutes
- CLI Usage — Command line reference
- Validation Guide — Understanding validation layers
- API Reference — Full API documentation
For AI Assistants¶
- llms.txt — Quick context for LLMs
- llms-ctx.txt — Extended context with API details
Contributing¶
We welcome contributions! See our Contributing Guide to get started.
License¶
MIT License - see LICENSE for details.