Skip to main content

DTCS — Data Transformation Contract Standard

CI crates.io PyPI License

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, analyze, plan, optimize, match, compile, and run contracts in Rust and Python
Spec status Draft (1.0.0-draft)
Reference implementation 0.9.0 — validation, analysis, registries, standard libraries, plan lowering, optimization, capability matching, compilation, and reference runtime
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, trace dataset lineage, lower validated contracts to transformation plans, optimize plans with semantics-preserving rewrites, match plans against engine capabilities, compile to execution plans, and run contracts in the reference in-memory runtime — including end-to-end execution of sample contracts like customer_normalize.dtcs.yaml.

Documentation · Quick start · User docs · Adoption · Examples · Changelog · Roadmap

Install

Requirements: Python 3.9+ (PyPI package); Rust 1.75+ (cargo install or building from source).

pip install dtcs
cargo install dtcs

dtcs version
dtcs validate examples/customer_normalize.dtcs.yaml

Both packages install the dtcs CLI on PATH:

validate · analyze · plan · optimize · match · compile · run · inspect · diagnostics · compat · evolve · lineage · registry · version

Develop from source (requires Rust + maturin): see CONTRIBUTING.md.

Quick start

# Validate a contract (exit 0 = valid)
dtcs validate examples/customer_normalize.dtcs.yaml

# Analyze a contract (static semantics; no runtime evaluation)
dtcs analyze examples/customer_normalize.dtcs.yaml

# Lower a validated contract to a transformation plan
dtcs plan examples/customer_normalize.dtcs.yaml

# Optimize a lowered plan (contract path lowers first)
dtcs optimize examples/customer_normalize.dtcs.yaml
dtcs match examples/customer_normalize.dtcs.yaml
dtcs compile examples/customer_normalize.dtcs.yaml
dtcs run examples/customer_normalize.dtcs.yaml --input tests/fixtures/runtime/customer_normalize_input.json

# Human-readable summary
dtcs inspect examples/customer_normalize.dtcs.yaml

# Compare two contract versions
dtcs compat examples/analysis/backward_old.yaml examples/analysis/backward_new.yaml

# Trace lineage impact
dtcs lineage examples/analysis/lineage_multi.yaml --impact customers

# Resolve a standard identifier
dtcs registry resolve dtcs:lowercase
import json
import dtcs

report = dtcs.parse_and_validate(
    open("examples/customer_normalize.dtcs.yaml", "rb").read()
)
assert dtcs.is_valid(report)

plan = dtcs.plan_lower(dtcs.parse_file("examples/customer_normalize.dtcs.yaml")["contract"])
optimized = dtcs.plan_optimize(plan["plan"])
assert dtcs.plan_equivalent(plan["plan"], optimized["plan"])

compiled = dtcs.compile_plan(plan["plan"])
inputs = json.loads(open("tests/fixtures/runtime/customer_normalize_input.json").read())
result = dtcs.runtime_execute(compiled["plan"], inputs)
assert dtcs.is_valid(result)
assert result["outputs"]["customer_clean"][0]["email"] == "alice@example.com"

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.9:

DTCS Document
        │
        ▼
Parser → Canonical Object Model
        │
        ├──────────────────────────────┐
        ▼                              ▼
Validator (0.1–0.6)              Analyzer (0.3, 0.6)
        │                              │
        │  registry::resolve           ├─ compatibility::analyze
        │  stdlib definition checks    ├─ analyze_evolution
        ▼                              ├─ versioning::validate
Diagnostics                            └─ lineage::analyze
        │                              │
        ▼                              ▼
   Plan lowering (0.7)            Analysis reports
        │
        ▼
   Plan optimization (0.8)
        │
        ▼
   Capability matching (0.9)
        │
        ▼
   Compilation (0.9)
        │
        ▼
   Reference runtime (0.9)
        │
        ▼
Transformation Plan → Execution Plan → Outputs

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). Phase 0.6 adds static semantic analysis. Phase 0.7 lowers validated contracts into transformation plans with dependency graphs and plan validation. Phase 0.8 optimizes plans with semantics-preserving expression, function, action, and rule passes. Phase 0.9 adds engine capability matching, compilation to execution plans, and a reference in-memory runtime covering all embedded dtcs: stdlib entries.

Production ETL orchestration and external engine backends 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, writing contracts, expressions, compatibility, JSON output, troubleshooting, FAQ
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. See CODE_OF_CONDUCT.md for community standards.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dtcs-0.9.0.tar.gz (233.6 kB view details)

Uploaded Source

Built Distributions

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

dtcs-0.9.0-cp39-abi3-win_arm64.whl (1.7 MB view details)

Uploaded CPython 3.9+Windows ARM64

dtcs-0.9.0-cp39-abi3-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.9+Windows x86-64

dtcs-0.9.0-cp39-abi3-win32.whl (1.6 MB view details)

Uploaded CPython 3.9+Windows x86

dtcs-0.9.0-cp39-abi3-musllinux_1_2_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

dtcs-0.9.0-cp39-abi3-musllinux_1_2_i686.whl (2.3 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

dtcs-0.9.0-cp39-abi3-musllinux_1_2_armv7l.whl (2.3 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

dtcs-0.9.0-cp39-abi3-musllinux_1_2_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

dtcs-0.9.0-cp39-abi3-manylinux_2_28_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

dtcs-0.9.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

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

dtcs-0.9.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ s390x

dtcs-0.9.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ppc64le

dtcs-0.9.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.0 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARMv7l

dtcs-0.9.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl (2.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.5+ i686

dtcs-0.9.0-cp39-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

dtcs-0.9.0-cp39-abi3-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file dtcs-0.9.0.tar.gz.

File metadata

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

File hashes

Hashes for dtcs-0.9.0.tar.gz
Algorithm Hash digest
SHA256 1ae33d842327b5ffd4664a570234c8d52443569308ba4e65d47e9651c418e7be
MD5 eb69a02581a2fe1dcadef15dfa534295
BLAKE2b-256 57e091db4fad1220594e93c148caf70e668a64ca8c2a51a294cd012ece0c72ae

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-win_arm64.whl.

File metadata

  • Download URL: dtcs-0.9.0-cp39-abi3-win_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.9+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 9332fafa62b3a7c45d2ba071bf004d8c71b85cf5c73c79a8a50650ef38e102e8
MD5 dcb70f223406b977ad9a1d2f1d1475ca
BLAKE2b-256 e9524b276af0850df9d3221665297b30ff1bf386875d79008d2f3bbbec0178b5

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: dtcs-0.9.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 803f2b8b3f79ff2436ab0c0d2f6dd533cbad809516f66909864a8cd96a8444ea
MD5 d745fb581254d7446b923cd61cde909b
BLAKE2b-256 c08875f92eb0ffca7a64d0e35dad69bb58e35a2d801c09d9b9e99c1571794960

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-win32.whl.

File metadata

  • Download URL: dtcs-0.9.0-cp39-abi3-win32.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 533a3755ab3907cc2c6e943a309e164a8ac047a3dda41c04b1df6c5842c03a72
MD5 164a01127c9b157abb4e170b9a77239a
BLAKE2b-256 41d48421dbede4e58618ae934b099c44f73ca3286af039744eebff72418fec5b

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7a7cc5c47a753b6f027ae1182c842c60fe106b733414d1195f7ed17e9e69374b
MD5 0a13540ce73860175f46f791bb80b411
BLAKE2b-256 c31207e8c0e5fd4bd89f8bf97acd7d72cd4f2c34f2f7b3accfe374e99abe340f

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 6ebdd952a9395c829a12e57bc7d7d578dcb454d6f4d9a6db28e8a493ef3942e4
MD5 4ed39f10a8d3321a2f5e2feebc315058
BLAKE2b-256 212594d673eb5d1b02b49b63ae5d4771825a34f65ca6494154e55e5714c38384

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 10a7982c2ba2abc7640cf924e19ff0664d08aae4a09ff060b4a50b8f65780b2b
MD5 99e8acb06f1512dd42f0611252488ea9
BLAKE2b-256 54020f5c4e722f8adfceb8b5d513364866a0ebfb6f75df023e638126f01192fa

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3488ed46a3ad6534763874e15babe97865491364d9a8af470dbc48e48f783e49
MD5 bd1a03b034efb91262c19db2e3246aa2
BLAKE2b-256 3fe0a22ed2d38ed78203b1be5ae9568cf2392ee93fd8b2a32cc8bd3611e81053

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cf31845c567aa3d7648464ba36167b8a979b2a43658927f835a621a68b04159a
MD5 71ff849f4d689f85d5d8392d22a0efd2
BLAKE2b-256 d2ef3d1991ea8955aa7eb5efefb239ab684b87982540e0c8a00416a940b9213f

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a90d7ec5f6d950887cc38bd6574b66593aa9f8268daa501fc34905e3b5d82970
MD5 515b0bb8e90f977e57223a5d2b7f8eb1
BLAKE2b-256 bfba1cb12d3ab1b95f23079cf77d0d4f612f157e907f84bd837a664a3757d7bd

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 b90dbb1e428419b8e5f0c78b7c0576bf5c2124d35debc016345f1d96c0c158c1
MD5 851d124b91bc693bfa1b8dfb5a6582ea
BLAKE2b-256 02f3f3152a887b807e379a932ef90bdf5aaeff02522e5c7159a15b73b69f82c5

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 04dc69863cc9d2c131d67f4045d2175045fbca8d12a1fad41a7fd36db8e0e3d7
MD5 530888fdffdbcc6f5af0e3f393b69ca0
BLAKE2b-256 a6e4e3a2a93586bff43cc2b1974f70fa76588c389927e75991109db80dea64b0

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 db90be70a212325b4f55e0386f5582f12a15daa055773289d35379578333e175
MD5 14cab66f1105b2a1391c904c3b0b28dd
BLAKE2b-256 525787b1714805f0765d6b22077c85eed5f4e338f073d26dc9cdd86b91e1b3ec

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 42ef1ee7170f7df363551bde4b8a8ade58d2725ec178bc0fb280107616140c04
MD5 2af3950e1ef56b79ccfcefe224c15b28
BLAKE2b-256 74025ca1627345626265a13f608d7e721f427109ec93c9bc013333c962d667fb

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ebae1a5b97111c4814e6196ba5707462f9a7528548a8ad81cbf9dd9ba54c4c4a
MD5 e0fcf6fca716bcbbdf671f5150bd4b92
BLAKE2b-256 a1481e42c9e4630813b065dcef2236f8e2166c908d4972774926079903a57a2b

See more details on using hashes here.

File details

Details for the file dtcs-0.9.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dtcs-0.9.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 73385628b8e270a5d353962b36b5b29b8dbcbc9e27086520cb533c3cba31181c
MD5 076a1d2896cece9312ac3f3df782037b
BLAKE2b-256 1656613d6fe18f740f799dd2983fe07b0a3f2f79a5b30a3bce82a8d789f54cf2

See more details on using hashes here.

Release history Release notifications | RSS feed

0.13.0

16 files

0.12.0

16 files

0.11.0

16 files

0.10.1

16 files

This release

0.9.0 This release

16 files

0.8.0

16 files

0.7.0

16 files

0.6.0

16 files

0.5.0

16 files

0.4.0

16 files

0.3.0

16 files

0.2.0

16 files

0.1.2

16 files

0.1.1

5 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page