skillfed

datacontract-cli

The datacontract CLI is an open source command-line tool for working with Data Contracts. It uses data contract YAML files to lint the data contract, connect to data sources and execute schema and quality tests, detect breaking changes, and export to different formats. The tool is written in Python. It can be used as a standalone CLI tool, in a CI/CD pipeline, or directly as a Python library.

datacontract-cli v1.1.1 1.5M downloads/30d#3,854 on PyPI1,036
Permissive license MIT Active released

What it is and what it does

The datacontract CLI is a command-line tool for managing data contracts—formal specifications that define the structure, quality, and freshness expectations of data products. It reads contract definitions in YAML format (following the Open Data Contract Standard) and validates that actual data in databases matches those specifications by running schema checks, quality assertions, and freshness tests. The tool connects to multiple data platforms and can generate outputs in SQL DDL, HTML, and other formats.

You use it to catch data quality issues early, document data products formally, enforce contracts in CI/CD pipelines, and detect breaking changes between contract versions. It ships with 21 runtime dependencies covering YAML parsing via pyyaml and ruamel.yaml, JSON schema validation via fastjsonschema and jsonschema, cloud SDKs like boto3, and templating via Jinja2 and jinja_partials, so it's a fairly complete toolkit rather than a lightweight utility.

Use it for:

  • Validate that a database table conforms to a published data contract before consuming it downstream
  • Generate SQL DDL from a data contract YAML to keep schema definitions in sync
  • Run schema and quality checks in a CI/CD pipeline whenever a data product is updated
  • Import an existing database table into a contract definition to establish a baseline contract
  • Detect breaking changes between two versions of a data contract and report them

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A CLI tool for defining, validating, and testing data contracts using the Open Data Contract Standard, with support for schema validation, quality checks, and exports across multiple data platforms.

Yes, if you work with data products or need formal data governance. The tool is actively maintained, has no known vulnerabilities, and solves a real problem in data engineering. Install friction is low. The main consideration is whether your data sources are among the supported platforms and whether you need the full dependency tree; if you only lint YAML contracts without testing live data, the overhead is lighter.

Install

datacontract-cli on PyPI

pip

pip install datacontract-cli

uv

uv add datacontract-cli

poetry

poetry add datacontract-cli

Installing datacontract-cli

Before you install

Low friction install with a pure Python wheel. Active maintenance with a recent release (2026-08-14) and 1036 repository stars. Supports Python 3.10 through 3.14, though the 21 runtime dependencies (including pydantic, sqlglot, boto3, and Jinja2) mean initial installation pulls a substantial dependency tree.

License in practice

MIT license permits commercial and private use with minimal restrictions, making it suitable for enterprise data engineering workflows without licensing concerns.

Quickstart

# Install
pip install datacontract-cli

# Test a data contract
export DATACONTRACT_POSTGRES_USERNAME=user
export DATACONTRACT_POSTGRES_PASSWORD=pass
datacontract test https://datacontract.com/orders-v1.odcs.yaml

# Export to SQL
datacontract export sql https://datacontract.com/orders-v1.odcs.yaml

Requires Python 3.10 or later (supports up to 3.14). Testing against live databases requires appropriate credentials and network access to the target data source.

Verify before relying

  • Whether the package can be used as a Python library directly or if CLI invocation is the primary interface
  • Performance characteristics when testing large datasets or complex schemas
  • Extent of custom export and import capabilities mentioned in the documentation

Package facts

License MIT (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 21 — typer, click, pydantic, pydantic-settings, pyyaml, ruamel.yaml, requests, truststore, fastjsonschema, jsonschema, pytz, python-multipart, rich, sqlglot, python-dotenv, boto3, Jinja2, jinja_partials, datacontract-specification, open-data-contract-standard, deepdiff
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Downloads 1,479,387/month — #3,854 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: datacontract_cli-1.1.1-py3-none-any.whl

Keywords: data-contract, data-contracts, odcs, open-data-contract-standard, data-quality, data-governance, data-mesh, data-product, data-engineering, schema, dbt, snowflake, databricks, bigquery

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DatabaseTopic :: Software Development :: Quality AssuranceTopic :: Software Development :: Testing

Tags

data contract validation CLIschema testing data qualityopen data contract standarddata governance automationdata mesh contract enforcementdatabase schema compliancedata product testing
data-governancedata-qualityschema-validation

More Testing packages