How to create a data contract from a CSV in 60 seconds
No database access, no setup, no YAML by hand. Upload a sample CSV and download a ready-to-use ODCS data contract.
Writing a data contract by hand is the reason most teams never start. You can skip all of that. Give DQHub a small sample of your data and it writes the contract for you — schema, types, keys, and quality checks — as a standard ODCS file you download and keep.
You never connect your database to DQHub. Only the sample you paste is sent. Nothing else leaves your machine.
What you need
- A CSV file with a header row (the first row is your column names).
- 10–100 sample rows is plenty. A small, non-sensitive sample is best.
Step by step
- Go to [dqhub.io/contracts/new](/contracts/new).
- Type a name for the table (for example,
orders). - Upload your CSV file, or paste the rows into the box.
- Click Generate contract.
- Review what DQHub found — the columns, their types, which column is the primary key, and which can be empty.
- Click Download to save your contract as
<table>.odcs.yaml.
That's it. You now have a real, standards-compliant data contract.
What you get in the file
The download is an Open Data Contract Standard (ODCS) v3.1 file. It contains two things:
- The schema — every column, its type, whether it can be null, and the primary key / unique columns DQHub detected.
- Starter quality checks — for example "this column has no nulls", "this id is unique", "this status is one of the values we saw", and "the table is not empty".
The checks are marked as warnings on purpose. They are a starting point inferred from your sample — open the file, keep the ones that are right, and promote the important ones to errors.
A tiny example
Paste this:
order_id,status,amount,created_at
1001,paid,42.50,2026-01-02
1002,refunded,18.00,2026-01-03
1003,paid,99.99,2026-01-04…and you get a contract where order_id is the primary key, amount is a number, status is an enum of paid/refunded, created_at is a date, plus checks for nulls, uniqueness, and row count.
What to do next
- Hand the
.odcs.yamlto your team or commit it next to your data model. - Compile the quality checks to Soda, dbt, Great Expectations, SQL, or Spark from the pack export — one definition, every engine.
- Have a compliance dataset? Start from a certified template instead and get retention and ownership filled in too.
Questions or a format you'd like us to support next? We'd love to hear it.