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.12.0.tar.gz (139.0 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.12.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.12.0.tar.gz.

File metadata

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

File hashes

Hashes for dpcs-0.12.0.tar.gz
Algorithm Hash digest
SHA256 f009b9b446dbca1aba080020b27ba04fcd93a420ba0acfc8977dedf3366007c1
MD5 0071ab65ed8732abbfd41c73348468ba
BLAKE2b-256 2ce49d95c370c0e037b5549c48f0bf0f881f7d3f5c275e8bc9008913bd41851d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dpcs-0.12.0-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 aaa0ac5105ec9754b6751d2e1d34eab06e47ac5b9ed08d4a4b17e7e29acf0b1e
MD5 d7ca77cfbfc33b46e7754cfb3d963bf5
BLAKE2b-256 d06b444ebdcba4c504773962b2e2e34196725f5edf52e302b1fa8ba3bc58be8c

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