Skip to main content

Python SDK for Digital Product Passports (DPP) — idiomatic Pydantic v2 port of the Java DPP SDK

Project description

dpp-sdk (Python)

Python SDK for Digital Product Passports (DPP) — an idiomatic Pydantic v2 port of the Java DPP SDK in the sibling repo ../dpp-sdk-platform.

Install

pip install dpp-sdk

Requires Python 3.11+.

Quickstart

from dpp_sdk import Dpp4Fun, from_json, to_json, validate_dpp4fun

# Parse an incoming passport (accepts both flat and nested JSON shapes)
dpp = from_json(raw_json)

# Validate against the DPP rule set (raises on violations)
validate_dpp4fun(dpp)

# Serialize back to the flattened wire JSON
payload = to_json(dpp)

The httpx-based HTTP clients for the DPP repository and registry live in dpp_sdk.clients:

from dpp_sdk.clients import DppRepoClient, DppRegistryClient

See docs/PORTING_PLAN.md for design notes and docs/RELEASING.md for how releases are cut.

Scope

Package Purpose Java source ported from
dpp_sdk.core Reusable core DPP model, validation, JSON transport dpp-datamodel/dpp-core
dpp_sdk.dpp4fun Furniture-specific DPP aggregate dpp-datamodel/dpp4fun
dpp_sdk.clients HTTP clients for the DPP repository & registry APIs dpp-sdk-clients

The Spring Boot mock services in ../dpp-sdk-platform/dpp-sdk-demo are not ported; they are reused as a conformance oracle for client tests.

Development

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

pytest        # tests
mypy          # type check (strict)
ruff check .  # lint

Layout

src/dpp_sdk/
  core/        # core model + validation
  dpp4fun/     # furniture aggregate, validation, JSON transport
  clients/     # repo + registry HTTP clients
tests/         # pytest suite
docs/          # PORTING_PLAN.md, RELEASING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dpp_sdk-0.1.0.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dpp_sdk-0.1.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file dpp_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: dpp_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dpp_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 17de0214dd8855c53b23b1b6a70c68d1fab78dcd8ca9714a88761c5c6124d360
MD5 248165fa28f2b8fb646dcdb0b1001efc
BLAKE2b-256 8b8ab6a129b59c2b567b8df599cba558a649b1fb63e30499252d3cac9860de01

See more details on using hashes here.

Provenance

The following attestation bundles were made for dpp_sdk-0.1.0.tar.gz:

Publisher: release.yml on CIR4FUN-EU/dpp-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dpp_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dpp_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dpp_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebf82b16f07741dc0a7203cd07e9a39d0b25b18ec3c8546db36115c422326592
MD5 08a1a1a6036e9dee78bbe814918519bd
BLAKE2b-256 1bb8d0f050e15343017b38fb411291de784119cce9c68785f8de5997191d89ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for dpp_sdk-0.1.0-py3-none-any.whl:

Publisher: release.yml on CIR4FUN-EU/dpp-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page