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.7.0 — validation, analysis, registries, standard libraries, and transformation plan lowering
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, and lower validated contracts to transformation plans — 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 · 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

# 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"])
assert dtcs.is_valid({"diagnostics": plan["diagnostics"]})

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

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
        │
        ▼
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.

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.7.0.tar.gz (174.7 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.7.0-cp39-abi3-win_arm64.whl (958.4 kB view details)

Uploaded CPython 3.9+Windows ARM64

dtcs-0.7.0-cp39-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

dtcs-0.7.0-cp39-abi3-win32.whl (929.4 kB view details)

Uploaded CPython 3.9+Windows x86

dtcs-0.7.0-cp39-abi3-musllinux_1_2_x86_64.whl (1.4 MB view details)

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

dtcs-0.7.0-cp39-abi3-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

dtcs-0.7.0-cp39-abi3-musllinux_1_2_armv7l.whl (1.4 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

dtcs-0.7.0-cp39-abi3-musllinux_1_2_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

dtcs-0.7.0-cp39-abi3-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

dtcs-0.7.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.7.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.7.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.7.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.7.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.7.0-cp39-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

dtcs-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for dtcs-0.7.0.tar.gz
Algorithm Hash digest
SHA256 aefa3462d591b222d1b8000cadc136a8ac7257fc3276411dd35ee69d4d0c0454
MD5 9657c0c3b355f09cfa213ab3f4501277
BLAKE2b-256 5061337f125d55beb6820ede94ca7ebe9bea9b1ffe5f2dbc0738643869139a7d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 2a13b6422638562bf81be66a39177011b5342945edf9e210d7ba759a9f1e103c
MD5 926f96704718c5b7c12ff03f55480528
BLAKE2b-256 dd22214b9b51e5149bf355770eb70a212a96c50ca743aeb285cc0ebd6742c3b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtcs-0.7.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.0 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.7.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fd515b369f5d46958ea5f37dbbe8f154c6286906166bbd3d06d800f766177db3
MD5 04f9cb9d85069451ac030e7fb1bdea4b
BLAKE2b-256 91c5e290e34ff8c8f671a2e57890ef4e41644ee4ff98f47483fc2c40020eff1a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 990744a2bd925ba5d89c1635cfbe2463947038a6c43ed4123d56a2edc73b0634
MD5 12d3ad78b41f65ac83f1405ae2bb66e4
BLAKE2b-256 11ff24ac6dc69f00a78c3e370874cdb50c9f90e08ebc6ce0fd8f71e3a3a0642d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f87e868548e23e7cd7075ecf982c913a5ab5c815c88a0119bce8c9bfdbdc1601
MD5 c4cf9ed1a39d635970ad42a4ba64c000
BLAKE2b-256 26a89175c01a2a27510d519cc15259878b682883e344cea52b4dd24b107b3ebd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 fdf90c8de2f4cfeb4c57a8077e3fbce848776d4594f746e62e1d2a13f9d9ec87
MD5 4ba64dd6be93ce3847c2f7bf6ce492cc
BLAKE2b-256 278f5229ccba5f44c84609c57003e094bbed39fc5266839f4a4827b89e737af1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 e98c86341bbbf95feea162d833a60c3e6d86288a1d1e36cb14ec6241e99d018e
MD5 46d7559abfdaa3ebaa497efe07fa8f6a
BLAKE2b-256 ef4cc17330695f24557bdf857bbbf0c59e5acba99c6537e8e98b78bd9d8a0697

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d00a4165e2d932fe5e4820e74f8f0c9c0fe5bfd650c1117e00ed64051bd4a289
MD5 6620f199462903dc3d0eac67e3fd277a
BLAKE2b-256 00c1a0da7cbbe24f67a507b1f752147104fbaded85930a138fc7ebe38710d00f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 759e7cad4f18b11ddc16516d68fd6ae78d07e597f6f4edc91634aba80564988e
MD5 13736d615498f7ceea17b3754a0625f7
BLAKE2b-256 2c51e29b64920a43d27690a53c8757840007cfe161abe6e743701cb9c796ab52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 019004d396578832c5202b743a9b600bd952b06877275d8cc7535c4348510d1d
MD5 0de0a91d84441a5489f99536ab15d879
BLAKE2b-256 305c92f76485215fba176daef6abd1c01a1477646361215994ce34b9c7d5a83c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 f3f20beff95781a691966bc7bde9c4625ddcd2fbbb29ffad339f08da56bf26df
MD5 cbf8ebb74775fb24152341c43129472f
BLAKE2b-256 f66b383b45c28cf23bae6fef443834e3843dc59557abffa50b8cc50f6c2bfea9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 90993cd2ea0d3f1abae56fcc99f692b71e783e3c8a1089763b5d7348907789d9
MD5 2f897f7b9cfee29519577e2b913f89d2
BLAKE2b-256 a12b228098efd60826f09ec5cbc5105b25d5d6aa3638cfc885a8bc0779002a4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 dd5e2110b13eb50bc7a6757ef62b6f100aa72569086bbcd554072377166e51ee
MD5 594dbe4c92f71e138807d93679c3960e
BLAKE2b-256 7e0a568ac84eaca7f6ac50a7ce26b7ee1f5a4e89db929c416a694201670ee14c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 51d7279b0165e5e77a30fc24066f7660e05243585a3f9aeccda881976b961d2b
MD5 846018c96fc2e1305c7e7031507615b8
BLAKE2b-256 67ce4ded790d60ac768ec822967907dfccf876c9bbdc10c3729a23b354550350

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1466760f17c8c3bdc91dcfd92c3fa62b7a62bf8eabd1d9a25843bdbd94b7e4e3
MD5 4929e5a799382c0260237bdced0548d1
BLAKE2b-256 116c2b4b8e9e8cc5f74497d6002da6ffe0ccf4f7ba91d9a3d0f85df1f4ea19d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtcs-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3c6fac2b126ef2cb2310f2dec9b115ab0b7a5c9038ac29e5984cb3ab1e408e10
MD5 d6416b552919c0e3c82cbf3e0b338072
BLAKE2b-256 09905fe09562496061775ce23fd811acb4e9fde8c59d52970e139909d5919bad

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

0.8.0

16 files

This release

0.7.0 This release

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