Skip to main content

opendpp-sdk

Official Python SDK for the OpenDPP Digital Product Passport API — a fully-typed client (pydantic v2 + urllib3, synchronous) mechanically generated from the public OpenAPI contract (openapi.json) and version-locked to it: this package's MAJOR.MINOR is the contract version it targets.

The only hand-written code is the thin opendpp_sdk.ergonomics module. Everything else under opendpp_sdk/ is generator-owned, regenerated by scripts/regenerate.sh and drift-checked in CI.

Install

pip install opendpp-sdk

Python ≥ 3.9. Runtime dependencies: pydantic>=2, urllib3, python-dateutil, typing-extensions.

Quick start

import os

from opendpp_sdk.api.passports_api import PassportsApi
from opendpp_sdk.api.service_api import ServiceApi
from opendpp_sdk.ergonomics import create_opendpp_client

client = create_opendpp_client(api_key=os.environ["OPENDPP_API_KEY"])

health = ServiceApi(client).get_health()          # public — works without a key too
passports = PassportsApi(client)
created = passports.create_passport({"productId": "09501101530003", "metadata": {"category": "batteries", ...}})

create_opendpp_client() defaults to the public hosted node (https://opendpp-node.eu); pass base_url= for a workspace host. The API key is sent as Authorization: Bearer … on operations that declare a security requirement — public operations (the resolvers, the validators, the audit verifier) work without one.

Content-negotiated public resolvers

The 200 of GET /passport/{id}, /01/{gtin14}, /8003/{grai} and /unit/{id} is negotiated via the Accept header (JSON-LD default / AAS / VC-JWT / VC-LD / SD-JWT-VC / HTML). The generated operations are typed against the default JSON-LD document; the resolve_*_as helpers are the supported way to request an alternate representation — they set the Accept header AND the matching body parsing, and type the result per media type:

from opendpp_sdk.ergonomics import resolve_public_passport_as

doc = resolve_public_passport_as(client, passport_id, "application/ld+json")   # PublicPassportJsonLd
aas = resolve_public_passport_as(client, passport_id, "application/aas+json")  # AasEnvironment
jws = resolve_public_passport_as(client, passport_id, "application/vc+jwt")    # compact JWS str

Tolerant by design

Response models never reject unknown fields — a future MINOR server release may add response fields, and deployed clients must keep working. Unknown keys are captured losslessly in each model's additional_properties.

Versioning

This package's version is locked to the API contract at major.minor (enforced by scripts/check_version_lock.py); the PATCH digit is the SDK's own fix lane, so a client-only fix can ship against an unchanged contract. Pin the MAJOR — a breaking contract change ships as a new /api/vN path major.

Regenerating

./scripts/regenerate.sh   # normalize the vendored spec, wipe, regenerate (needs node + a JRE)

The generation input is the vendored contract rewritten by the shared normalizer (../scripts/normalize-spec.mjs — authored and unit-tested in the OpenDPP node repository, synced here); the vendored openapi.json itself stays the pristine published contract. Generated sources are committed; CI regenerates and fails on any diff.

License

Apache-2.0 — see LICENSE and NOTICE. "OpenDPP" is a trademark of Opendpp UAB; the license grants no rights to the marks (see TRADEMARK.md).

Metadata

Release files for opendpp-sdk 1.18.0

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

Source distribution (sdist)

Source distribution for opendpp-sdk 1.18.0
File Size Uploaded Provenance Actions
opendpp_sdk-1.18.0.tar.gz 324.8 kB With provenance Details for opendpp_sdk-1.18.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opendpp-sdk 1.18.0
File Interpreter ABI Platform Actions
opendpp_sdk-1.18.0-py3-none-any.whl Python 3 none any Details for opendpp_sdk-1.18.0-py3-none-any.whl

Total release size: 1.7 MB

Release files / opendpp_sdk-1.18.0.tar.gz

Download URL opendpp_sdk-1.18.0.tar.gz
Size 324.8 kB
Tags Source
SHA-256 checksum
How to use checksums
517522f5ac7fa8204c42dd3f701d03ce846d0ced5da100ac852e6af8a54b9c08
BLAKE2b-256 checksum
How to use checksums
deede9bd1dd1d9520882d59f3ddca8c7cc464d1e8c08ce279bebd05ed3f56ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / opendpp_sdk-1.18.0-py3-none-any.whl

Download URL opendpp_sdk-1.18.0-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8267e77aeb75dde3f4b6b1f94ff8fe8b033c79f1b2b794460dd605ae60823cbc
BLAKE2b-256 checksum
How to use checksums
63395511356352327f89d38c28b37066e295ee16a611d362565b38719b8c2c47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Security for opendpp-sdk 1.18.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for opendpp_sdk-1.18.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

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