--- id: datacontract-cli version: "1.1.1" license: MIT license_treatment: permissive maintenance: active --- # 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. License: permissive · Maintenance: active · Downloads: 1.5M/mo ## 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 above — 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 pip install datacontract-cli uv add datacontract-cli 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_current - Install friction: low - Maintenance: active - Downloads: 1.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags data contract validation CLI, schema testing data quality, open data contract standard, data governance automation, data mesh contract enforcement, database schema compliance, data product testing, data-governance, data-quality, schema-validation [View on SkillFed](https://skillfed.io/packages/datacontract-cli) · [View on PyPI](https://pypi.org/project/datacontract-cli/)