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, and analyze contracts in Rust and Python
Spec status Draft (1.0.0-draft)
Reference implementation 0.8.0 — validation, analysis, registries, standard libraries, plan lowering, and optimization
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, and optimize plans with semantics-preserving rewrites — 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).

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 · 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

# 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 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"])

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

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)
        │
        ▼
Transformation Plan

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.

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.

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.8.0.tar.gz (190.9 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.8.0-cp39-abi3-win_arm64.whl (1.0 MB view details)

Uploaded CPython 3.9+Windows ARM64

dtcs-0.8.0-cp39-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

dtcs-0.8.0-cp39-abi3-win32.whl (976.8 kB view details)

Uploaded CPython 3.9+Windows x86

dtcs-0.8.0-cp39-abi3-musllinux_1_2_x86_64.whl (1.5 MB view details)

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

dtcs-0.8.0-cp39-abi3-musllinux_1_2_i686.whl (1.5 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

dtcs-0.8.0-cp39-abi3-musllinux_1_2_armv7l.whl (1.5 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

dtcs-0.8.0-cp39-abi3-musllinux_1_2_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

dtcs-0.8.0-cp39-abi3-manylinux_2_28_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

dtcs-0.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

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

dtcs-0.8.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ s390x

dtcs-0.8.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ppc64le

dtcs-0.8.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARMv7l

dtcs-0.8.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl (1.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.5+ i686

dtcs-0.8.0-cp39-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

dtcs-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for dtcs-0.8.0.tar.gz
Algorithm Hash digest
SHA256 db7390e716eb5f9c0c9c4eded5b074441a685f223c74746bac7756e5135619c3
MD5 4fffb2f95988db2a6a528640f8503856
BLAKE2b-256 5d40f7158487a33974aa402af124892c50347a03406afa9082fe5e1049503dc9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 4bb71f9caa644b1e878d48abe31f160d3436995d1cc5b0778047348d9792ae40
MD5 68a4961f2fbc8cb1615f1441173ed521
BLAKE2b-256 bc9d455b9fa8c4c56e7236f2505edf8672f6e51d5178560133df39d5077bc055

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtcs-0.8.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 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.8.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 74b7804a750748c5b19d6893f52105f55ceebc48aff680646acf6f751c651e36
MD5 9b91def061341b4e70edfcdf4d0f2471
BLAKE2b-256 ebe9f33e78e81b414661217317e769a1f237558fbf1c4f1065c4c4d7d9f76f11

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 13941741d219e25c91671cd57300e08aefeff3f707a15ef35376d73f7f33150b
MD5 d89e4c24f19e6cb5275df1a54876e4d9
BLAKE2b-256 ab4758f8572979e3581d02428117e66426a3bb4a1d75d23c72631d61f11c8a74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f24bd9839e934632ca6884d8cac152a83c875e7c54ab289503469d52264e055e
MD5 3a3903e634c0c0b911729204a72124b7
BLAKE2b-256 78665aa0bfb9af78b47992b4b31756dc4d361fa222e32c2ffed98eec6c2ef16d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 4fd1a3681d003c649fe7073c10bfa993d11fd02c17e946787779c8978ff83cc6
MD5 178578a73415b4337c605631a5e5a443
BLAKE2b-256 d7a66b010cb9201f79eee450cacc0e7845a43678a2e53b6e3e7e2d5fcff12859

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 c9837c73a1603e34e76a5af793a6738ee524fc612a71b4054a3e950837277385
MD5 72115db5f627f0c87339d81fb83db0b9
BLAKE2b-256 ac615b99091b703719cc20ad62cf3e733e1cd0e90097fcbd78a336dfc1286597

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 793214c8f7783d1948fbf7135d81bf98539430b3304beb21834a53db55263a88
MD5 27bb98844349544c89e4ef9aad5df807
BLAKE2b-256 8b1001c13c1763b9add0654212e248b89937d3837cdd4651562a57021e673c9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4af9a1545a4a56655c8982692c18202eb364234414c399962a3ad0babd986088
MD5 25d8aec9ce6cc57606270d1c6b81ac41
BLAKE2b-256 9224ae678d17da5bdb4abe471aae37435ab71164815b9cecd6299bba01fa7b1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc1cd1b588894fc6af3a2bff694bf7e57b464082cfd89fb2cc236e398fe349c4
MD5 c8f657dcb91deebc7fca548d8b74dcaf
BLAKE2b-256 85d0fb2175814235da2618870922d7ac88c2e8c1a42c48d8a417951525d2ec7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 0e8e9174b1573304cdf4cb455440270323767b7479262893b9fb66dc73269413
MD5 c2ef5b01b63298370a38250854d47092
BLAKE2b-256 829ef96fea3df212cffae862a12b5779293b02567b6e57eaa17f4bdedddc3703

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 28790d90077b8765d6eb609bcc191c55cc6095f74809c396f423a72592749d72
MD5 0a28d8762dc222b6f461e4b99c478b48
BLAKE2b-256 f7087fe077382d0cd4785cda8c175f4cbe7e0929bb4572b0b949039523f336d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 01baeace88cf599adf9e09f587b8b22b276441f35c7cde196787a04f6f897cdb
MD5 b2f08e509a62605e062f652f25315146
BLAKE2b-256 10c9c78a242bf5455c737db1061b8a35ad60f4deeeb249cb3e4279deb5e62d5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 bb729867bfd6b5739914fe700159b2f0ead3cb29637501dd101543abf6b669cd
MD5 a5a71f370c3b61ed74c4d583569d71ce
BLAKE2b-256 b735e36305d625725d0c58fd1122c8e7d43e9acbe1b494d2e3040a04bbea00fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a6689c0869e9bcde8e5d5fe38b81b532b5ca439340fb315fa92fa4c30bc1fc2
MD5 dc4bfc93fcb61c64454def138c1399e1
BLAKE2b-256 7a80fd8758f30ce69caec9f3142756da31da1f95de4388c3174ae062362b834a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ad3f73d995282b4b516d699e7a2bf0fba9ee7223ac26f328e91b97edc5a33c37
MD5 b30ec41b4fa88643d16808fe0691ee40
BLAKE2b-256 25251ca44b37e6c1682f9e82a5a0f25ef679d37f86675f586c35bfa068e307d5

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

0.9.0

16 files

This release

0.8.0 This release

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