DTCS — Data Transformation Contract Standard
Vendor-neutral contracts for data transformation semantics — describe what a transformation means without locking you to Spark, SQL, Polars, or any single runtime.
This repository contains:
- SPEC.md — normative DTCS 1.0 draft (26 chapters)
- Reference tools — parse, validate, and analyze contracts in Rust and Python
| Spec status | Draft (1.0.0-draft) |
| Reference implementation | 0.6.0 — validation, analysis (Ch 7–8), registries, and embedded standard libraries with registry-driven semantics validation |
Document dtcsVersion |
1.0.0 (currently exact; patch releases are rejected) |
| Try it now | pip install dtcs or cargo install dtcs |
What you can do today: validate YAML/JSON contracts, resolve dtcs: identifiers through the embedded registry (including standard actions, functions, and rules), compare versions for compatibility, analyze evolution between revisions, and trace dataset lineage — all read-only, no execution engine required.
Quick start · User docs · Examples · Changelog · Roadmap
Install
Requirements: Python 3.9+ (PyPI package); Rust 1.75+ (cargo install or building from source).
Both packages install the dtcs CLI on PATH:
validate · analyze · inspect · diagnostics · compat · evolve · lineage · registry · version
Develop from source (requires Rust + maturin): see CONTRIBUTING.md.
Quick start
# Validate a contract (exit 0 = valid)
# Analyze a contract (static semantics; no runtime evaluation)
# Human-readable summary
# Compare two contract versions
# Trace lineage impact
# Resolve a standard identifier
=
assert
Read docs/user/getting-started.md for a full walkthrough. For normative definitions, see SPEC.md — start with Chapter 3 (COM) and Chapter 9 (Validation).
Pipeline
The reference implementation through Phase 0.5:
DTCS Document
│
▼
Parser → Canonical Object Model
│
├──────────────────────────────┐
▼ ▼
Validator (0.1–0.5) Analyzer (0.3)
│ │
│ registry::resolve ├─ compatibility::analyze
│ stdlib definition checks ├─ analyze_evolution
▼ ├─ versioning::validate
Diagnostics └─ lineage::analyze
│ │
│ ▼
│ Analysis reports
▼
(valid contracts only for analysis)
Phase 0.2 adds metadata validation, extended type system checks, expression typing, and I/O interface depth. Phase 0.3 adds compatibility classification, evolution analysis, versioning validation, and dataset-level lineage analysis. Phase 0.4 adds the identifier registry, file/URI loading with offline cache, and registry-aware extension validation. Phase 0.5 embeds starter standard libraries for semantic actions, functions, and rules, and validates contract usage against structured registry definitions (target types, phases, arity, and return types).
Execution, backend compilation, and runtime behavior remain out of scope. See docs/implementation/non-goals.md.
Repository layout
| Path | Purpose |
|---|---|
| SPEC.md | Full DTCS 1.0 draft specification (26 chapters) |
| docs/user/ | User guides — getting started, CLI, compatibility |
| docs/adoption/ | Adoption overview for evaluators |
| docs/implementation/ | Reference implementation design guides |
| docs/editorial/ | Specification authoring process |
| examples/ | Sample transformation contracts |
| src/ | Rust crate source (dtcs) |
| python/ | Python package source (dtcs on PyPI) |
| tests/ | Integration tests and fixtures |
| ROADMAP.md | Reference implementation milestones |
Contributing
See CONTRIBUTING.md for editorial conventions, implementation guidelines, and the review process.
When implementation guidance conflicts with the specification, SPEC.md wins. See docs/implementation/spec-usage.md.
License
Licensed under the Apache License, Version 2.0. See LICENSE.