import Head from ‘@docusaurus/Head’;

What is Data Contract CLI?

The datacontract CLI is an open-source command-line tool for working with data contracts.

It natively supports the Open Data Contract Standard (ODCS) to:

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.

Main features of the Data Contract CLI

Why data contracts?

A data contract is a machine-readable, versioned agreement that describes the structure, semantics, quality, and service levels of a data set. Because the contract is a single file, it can be:

A typical contract has a servers section with endpoint details, a schema describing the structure and semantics of the data, plus service levels and quality attributes that describe expectations such as freshness and number of rows. This is enough information to connect to the data source and check that the actual data product is compliant.

How it works

When you run datacontract test, the CLI connects to a data source and runs schema and quality tests to verify that the data contract is valid. Internally it uses different engines based on the server type — it connects with DuckDB, Spark, or a native connection, executes most checks with ibis (compiling dialect-specific SQL per backend), and validates JSON with fastjsonschema.

Next steps