Metadata-Version: 2.4
Name: dpp-sdk
Version: 0.1.1
Summary: Python SDK for interacting with Digital Product Passport (DPP) System Infrastructure 
Project-URL: Homepage, https://github.com/CIR4FUN-EU/dpp-sdk-python
Project-URL: Repository, https://github.com/CIR4FUN-EU/dpp-sdk-python
Project-URL: Issues, https://github.com/CIR4FUN-EU/dpp-sdk-python/issues
Project-URL: Changelog, https://github.com/CIR4FUN-EU/dpp-sdk-python/blob/main/CHANGELOG.md
Project-URL: Reference, https://github.com/CIR4FUN-EU/dpp-sdk-platform
Author: Enno Mueller
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: digital-product-passport,dpp,prEN-18222,sustainability
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.6
Provides-Extra: dev
Requires-Dist: mypy>=1.9; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: release
Requires-Dist: build>=1.2; extra == 'release'
Requires-Dist: twine>=5.1; extra == 'release'
Description-Content-Type: text/markdown

# dpp-sdk (Python)

Python SDK for **Digital Product Passports (DPP)**, built on [Pydantic v2](https://docs.pydantic.dev).

It provides typed models, validation, and JSON transport for digital product passports,
plus HTTP clients for the two DPP backend APIs:

- the **DPP registry** — hosted by the European Commission, and
- the **DPP repository** — hosted by economic operators or service providers.

Both APIs conform to the draft standardisation documents published by **CEN/CENELEC**.

## Install

```bash
pip install dpp-sdk
```

Requires Python 3.11+.

## Quickstart

```python
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 clients for the registry and repository APIs live in `dpp_sdk.clients`:

```python
from dpp_sdk.clients import DppRepoClient, DppRegistryClient
```

## Packages

| Package | Purpose |
|---|---|
| `dpp_sdk.core` | Core DPP model, validation, and JSON transport |
| `dpp_sdk.dpp4fun` | Furniture-specific DPP aggregate |
| `dpp_sdk.clients` | HTTP clients for the DPP registry & repository APIs |

## Development

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

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