Data Engineering

Data Contract Generator

Drafts a YAML or Markdown data contract from a sample, leaving the human decisions as TODOs.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste a header row and a representative sample of the data — twenty rows tells you more than five.
  2. Name the dataset and the owner, and pick YAML or Markdown.
  3. Select Draft contract.
  4. Work through every TODO with the people who own the data. Those are the parts a sample cannot answer.

What data contract generator does

The reason most datasets have no contract is not that nobody wants one, it is that starting from an empty file is unpleasant and the result has to be argued over anyway. Starting from something already half filled in changes the conversation from "will we write one" to "is this right", which is a far easier conversation to have.

This infers what a sample can support — field names, types, which fields were null, which looked unique, a candidate key — and leaves everything a sample cannot know as an explicit TODO: the owner, the freshness SLA, the classification, and what happens when a check fails. Those are not gaps to be filled with defaults. A contract nobody had to complete is a contract nobody agreed to.

Frequently asked questions

Because a sample of the data cannot know who owns it, how fresh it has to be, how sensitive it is or what should happen when a check fails. Filling those with plausible defaults would produce a document that looks agreed and is not. Every TODO is a decision that needs a person.

Only as far as the sample supports them. A column that was never null in twenty rows may well be null in the twenty-first, and the contract says so in a comment. Use the draft as a starting point for the conversation, not as evidence about the data.

It follows the shape most data contract specifications share — dataset, version, owner, schema, expectations — without claiming conformance to any particular one. If your organisation has a standard, treat this as the raw material to reshape into it.

It looks for the first column that was unique across every sample row and never null. That is a candidate rather than a conclusion, and when no column qualifies the key is left as a TODO rather than guessed at.