Skip to main content

Python bindings for the Data Pipeline Contract Standard (DPCS) reference toolkit

Project description

dpcs (Python)

PyPI Python Guides License

Python bindings for the Data Pipeline Contract Standard (DPCS) Rust reference toolkit. Parse, validate, plan, compare, and bind pipeline contracts from Python via PyO3.

Package dpcs on PyPI
Toolkit 0.11.x (ROADMAP developer-experience release)
Spec 1.0.0-draft
Requires Python ≥ 3.9 (abi3)
Guides dpcs.readthedocs.io
Bindings notes docs/BINDINGS.md

Install

pip install dpcs

Quick start

from pathlib import Path

import dpcs

source = Path("pipeline.dpcs.yaml").read_text()
report = dpcs.validate_yaml(source)

errors = [d for d in report["diagnostics"] if d.get("severity") == "error"]
assert not errors, errors

print(dpcs.version(), dpcs.dpcs_spec_version())
# or from a path (YAML or JSON):
# report = dpcs.validate_file("pipeline.dpcs.yaml")

API

Functions return JSON-compatible dict / list values (serialized from the Rust types) unless noted.

Function Purpose
version() / __version__ Toolkit version string
dpcs_spec_version() Spec version (1.0.0-draft)
parse_yaml_str(source) / parse_json_str(source) Parse a contract document
validate_yaml(source) / validate_file(path) Validate YAML/JSON (file auto-detects)
plan_yaml(source) Build a pipeline plan (or validation report on refusal)
evaluate_capabilities(profile_yaml, contract_yaml) Check orchestrator capabilities
bind_yaml(contract_yaml, profile_yaml, target) Emit scaffolding (airflow, dagster, prefect, temporal, kubernetes, …)
compare_contract_yaml(baseline, candidate) Compatibility comparison
validate_registry_yaml(source) Validate an artifact registry document
validate_conformance_profile_yaml(source) Validate a conformance profile
to_yaml_str(contract_json) / to_json_str(contract_yaml) Format conversion

CLI, report formats, and TUI are Rust-first (dpcs-cli); this package wraps the core library entry points. Full toolkit docs: dpcs.readthedocs.io.

Develop from source

Requires a virtualenv for maturin develop. The Python crate sits outside the Cargo workspace (workspace.exclude).

cd bindings/python
python -m venv .venv && source .venv/bin/activate
pip install maturin pytest
maturin develop
pytest -q

License

Apache-2.0 OR MIT — same as the main dpcs repository.

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

dpcs-0.11.0.tar.gz (131.5 kB view details)

Uploaded Source

Built Distribution

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

dpcs-0.11.0-cp39-abi3-manylinux_2_34_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

File details

Details for the file dpcs-0.11.0.tar.gz.

File metadata

  • Download URL: dpcs-0.11.0.tar.gz
  • Upload date:
  • Size: 131.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for dpcs-0.11.0.tar.gz
Algorithm Hash digest
SHA256 69cacbb742d911bcb5e76bab5247876b585d5e0216634eada09f736877fa83fd
MD5 0ea49cedb295e8a8763e466c62ed40dd
BLAKE2b-256 132c0a0bd14d807f53a7c6eebff443faefe317316d2f36383361b960dfe179ac

See more details on using hashes here.

File details

Details for the file dpcs-0.11.0-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dpcs-0.11.0-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5cbdfb5709ca28861aaba85a4117578ce1b7a48da679e6aae1bc0a9a20149ab7
MD5 b89fc6b27b5739d12c06f03aaec4acbc
BLAKE2b-256 b9fddc9037bd0b3bb5c014ad8aa61714d697ea989f3e0c27312abdbf2271a8b0

See more details on using hashes here.

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