Skip to main content

Installation

Python 3.10–3.14 are supported. We recommend Python 3.11.

The [all] extra installs every optional data-source dependency. To keep the install small, replace it with just the extras you need.

The preferred way to install is uv:

uv tool install --python python3.11 --upgrade 'datacontract-cli[all]'
datacontract --version

uvx (run without installing)​

If you have uv installed, you can run the CLI directly without installing it:

uvx --from 'datacontract-cli[all]' datacontract --version

pip​

python3 -m pip install 'datacontract-cli[all]'
datacontract --version

pip with venv​

Typically it's better to install into a virtual environment for your project:

cd my-project
python3.11 -m venv venv
source venv/bin/activate
pip install 'datacontract-cli[all]'
datacontract --version

pipx​

pipx installs into an isolated environment:

pipx install 'datacontract-cli[all]'
datacontract --version

Docker​

Use the Docker image to run the CLI without a local Python install — convenient for CI/CD:

docker pull datacontract/cli
docker run --rm -v "${PWD}:/home/datacontract" datacontract/cli

Create an alias to make it easier to use:

alias datacontract='docker run --rm -v "${PWD}:/home/datacontract" datacontract/cli:latest'
note

The output of Docker command line messages is limited to 80 columns and may include line breaks. Don't pipe Docker output to files if you want to export code — use the --output option instead.

The image is also mirrored to Amazon ECR Public:

docker pull public.ecr.aws/s4e5k7s9/datacontract-cli

Verifying the image​

Released images are signed with cosign keyless signing, using the GitHub Actions OIDC identity of the release workflow. There is no public key to distribute — verification checks that the image was built and signed by that workflow, in this repository, from a release tag.

Install cosign v2.6.3 or later (v3 or later recommended), then:

cosign verify datacontract/cli:latest \
--certificate-identity-regexp '^https://github\.com/datacontract/datacontract-cli/\.github/workflows/release\.yaml@refs/tags/v' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com

Both --certificate-identity-regexp and --certificate-oidc-issuer are required. Without them, cosign verify accepts any valid Sigstore signature — including one produced by someone else.

The same command works for the ECR mirror, which carries the signature and attestations along with the image:

cosign verify public.ecr.aws/s4e5k7s9/datacontract-cli:latest \
--certificate-identity-regexp '^https://github\.com/datacontract/datacontract-cli/\.github/workflows/release\.yaml@refs/tags/v' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com

Each image also ships an SBOM and SLSA provenance attestation, which you can inspect with:

docker buildx imagetools inspect datacontract/cli:latest --format '{{ json .SBOM }}'
docker buildx imagetools inspect datacontract/cli:latest --format '{{ json .Provenance }}'

Signatures are attached to images released after version 1.1.0. Older tags, 1.1.0 included, are unsigned.

Optional dependencies (extras)​

The CLI defines several optional dependencies (extras) for specific server types. With all, every server dependency except hana is included.

uv tool install --python python3.11 --upgrade 'datacontract-cli[all]'

Available extras:

DependencyInstallation command
API (run as web server)pip install datacontract-cli[api]
Amazon Athenapip install datacontract-cli[athena]
Avropip install datacontract-cli[avro]
Azurepip install datacontract-cli[azure]
Google BigQuerypip install datacontract-cli[bigquery]
ClickHousepip install datacontract-cli[clickhouse]
Databrickspip install datacontract-cli[databricks] (also inside a Databricks Runtime, using the cluster's own Spark session — see Databricks Notebooks and Jobs)
DataFrame (Spark)pip install datacontract-cli[dataframe] (PySpark not included — you supply the Spark session)
DBMLpip install datacontract-cli[dbml]
DuckDB (local file, CSV import and API response testing)pip install datacontract-cli[duckdb]
Exasolpip install datacontract-cli[exasol]
Excel (import / export)pip install datacontract-cli[excel]
Excel workbooks (testing)pip install datacontract-cli[xlsx]
GCSpip install datacontract-cli[gcs]
Apache Hivepip install datacontract-cli[hive]
SAP HANA / Dataspherepip install datacontract-cli[hana] (not part of all: hdbcli is proprietary)
Apache Iceberg (schema import and export, REST catalog testing)pip install datacontract-cli[iceberg]
Impalapip install datacontract-cli[impala]
Kafkapip install datacontract-cli[kafka]
MySQLpip install datacontract-cli[mysql]
Oraclepip install datacontract-cli[oracle]
Parquetpip install datacontract-cli[parquet]
PostgreSQLpip install datacontract-cli[postgres]
Protobufpip install datacontract-cli[protobuf]
RDFpip install datacontract-cli[rdf]
Amazon Redshiftpip install datacontract-cli[redshift]
S3pip install datacontract-cli[s3]
Snowflakepip install datacontract-cli[snowflake]
Microsoft SQL Serverpip install datacontract-cli[sqlserver]
Trinopip install datacontract-cli[trino]
XML Schema (import)pip install datacontract-cli[xml]

Each data source lists the extra it needs.