Skip to main content

Import: Amazon S3

Creates a data contract from files in S3, in CSV, JSON, Parquet, or Delta format. Works with S3 and any S3-compatible endpoint (e.g. MinIO).

datacontract import s3 \
--source s3://my-bucket/orders/*.json \
--output datacontract.yaml

The format is taken from the file suffix; pass --format for Delta tables, which have none, or to override the guess. Add --endpoint-url for an S3-compatible store, and --delimiter to pin how a JSON file is laid out (new_line, array, or none) instead of letting it be detected.

The objects are read with duckdb through the same connection the test path uses, so the import authenticates identically and infers the column types from exactly the reader that later verifies them.

The generated contract includes a ready-to-test servers block, so you can run datacontract test datacontract.yaml immediately afterwards — see the S3 connection guide for the full 5-minute walkthrough and troubleshooting.

Credentials are the same ones datacontract test uses: an existing AWS session, or DATACONTRACT_S3_ACCESS_KEY_ID and DATACONTRACT_S3_SECRET_ACCESS_KEY — see the S3 Reference.

Working from a local file instead? Use datacontract import csv, json, or parquet.