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.13.x (ROADMAP reference-implementation 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.13.1.tar.gz (150.4 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.13.1-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.13.1.tar.gz.

File metadata

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

File hashes

Hashes for dpcs-0.13.1.tar.gz
Algorithm Hash digest
SHA256 055bc2f1bb6fbce37c268d773deec2db926dd63a6cf367979532131ac47493e5
MD5 9913bdc716179bb55f1f210f47ca63e5
BLAKE2b-256 352ca8d9cbb6e58548977ca3a73a402e23a34825ae97384811c2628782b18650

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dpcs-0.13.1-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8cdc3a0608187810815d1acfc705799dceb7717afaac34d61f3e9b41954fcad7
MD5 0052eedfe4d87feb6e2e6bb8ba3d7f18
BLAKE2b-256 8d1101ac91e392e2649167e71d8f8589d10a502d34df31d00ef91042a322224d

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