Skip to content

Validate EU Digital Product Passports with Python - 80k ops/sec.

dppvalidator

PyPI version Python versions Downloads License CI Platform

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

```
uv add dppvalidator
```
```
pip install dppvalidator
```

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

For AI Assistants

Contributing

We welcome contributions! See our Contributing Guide to get started.

License

MIT License - see LICENSE for details.