dq-contract
/dq-contract
Drafts a YAML data contract from a sample CSV or Parquet file (types, required columns, unique keys, ranges, allowed values) and validates files against a contract, reporting each failed check with row numbers. Use when someone wants to agree what a dataset must look like, gate a pipeline on data quality, or check whether a new delivery matches what was promised.
- Author
- sumankrsh ↗
- Repository
- enterprise-data-skills ↗
- Licence
- MIT
- Last repository change
- 02.11.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 02.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/dq_contract.py
What it does and when to use it
Drafts a YAML data contract from a sample CSV or Parquet file (types, required columns, unique keys, ranges, allowed values) and validates files against a contract, reporting each failed check with row numbers. Use when someone wants to agree what a dataset must look like, gate a pipeline on data quality, or check whether a new delivery matches what was promised.
Original author description
Drafts a YAML data contract from a sample CSV or Parquet file (types, required columns, unique keys, ranges, allowed values) and validates files against a contract, reporting each failed check with row numbers. Use when someone wants to agree what a dataset must look like, gate a pipeline on data quality, or check whether a new delivery matches what was promised.
How it works
- Draft a contract
- Validate a file
- Contract format
SKILL.md preview
---
name: dq-contract
description: Drafts a YAML data contract from a sample CSV or Parquet file (types, required columns, unique keys, ranges, allowed values) and validates files against a contract, reporting each failed check with row numbers. Use when someone wants to agree what a dataset must look like, gate a pipeline on data quality, or check whether a new delivery matches what was promised.
license: MIT
compatibility: Needs Python 3.11+ with the enterprise-data-skills package installed. Parquet needs the [parquet] extra. Runs offline.
metadata:
version: "0.1.0"
author: Suman Mukherjee
---
# Data contracts
## Draft a contract
```bash
python scripts/dq_contract.py infer sample.csv --name customers --out customers.contract.yaml
```
The draft records what the sample showed: each column's type, whether it was always filled (`required`), whether it is a unique key (only for columns named `id`, `*_id`, `*_key` or `*_number`), the observed `min` and `max` for numeric columns that aren't keys, and `allowed` values for text columns with up to 10 distinct values. Tell the user that observed ranges are a starting point: they must widen or tighten them and set an `owner` before relying on it.
## Validate a file
```bash
python scripts/dq_contract.py validate customers.contract.yaml new_delivery.csv --format json
```
Exit code 0 means every check passed, 1 means at least one failed, 2 means the contract or file couldn't be read. Each result has `check` (row_count, column_present, no_extra_columns, required, max_null_pct, type, unique, range, allowed, pattern), `column`, `passed`, `failing` and up to five `rows` (1-based data row numbers). Values from the file are only shown after PII masking.
## Contract format
```yaml
contract: customers
version: 1
owner: Customer data team
allow_extra_columns: false
row_count: {min: 1, max: 1000000}
columns:
customer_id: {type: integer, required: true, unique: true}
email: {type: string, max_null_pct: 5, pattern: '[^@\s]+@[^@\s]+'}
segment: {type: string, allowed: [consumer, small_business, enterprise]}
monthly_spend: {type: number, min: 0, max: 5000}
```
Types: `integer`, `number`, `boolean`, `date`, `datetime`, `string`. Unknown keys are rejected, so typos don't silently disable a check.
Files in this package (2)
- SKILL.md 2 KB
- scripts/dq_contract.py 1 KB
Versions
The database has no other skills named dq-contract.
Database snapshot: 13.11.2026 · package version 47a684511413 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100data-quality-profile
Profiles a CSV or Parquet table (types, missing values, ranges, duplicates, extreme values, mixed types) and compares two snapshots of the same table for drift (schema changes, missing-value shifts, distribution shift measured with PSI). Use when someone asks whether a dataset… - 100data-processing
Use when working with structured data files (CSV, JSON, YAML, TOML, Parquet) — querying, transforming, filtering, aggregating, or converting between formats - 100data-dictionary-creator
Generate a data dictionary for a dataset, combining automatic profiling with the user's description of what the data represents. Use when the user wants documentation of columns — names, types, semantic meaning, units, allowed values, and nullability — for a CSV/Parquet/Excel file. - 95mparanza-reporting-engine
Use when Clara needs budgeting/forecast reports with both variances and Sites delivery, CSV/XLSX/Parquet dataset intake, Sales/Discount/COGS identification, chart capability evidence, dataset profiling, a source-backed dataset semantic layer, mechanical compatibility checks, or… - 100schema-contract
Declare a data contract for a feed or table (CSV rows, list of dicts, JSON lines) and enforce it - per-column type (int/float/str/bool/date/ISO datetime), required/nullable, range, enum, regex, unique single or composite key, monotonic timestamps per key, max gap between… - 100data-contract
Use when a table or dataset is consumed by others and must not break silently - define a data contract (schema, keys, nulls, allowed values, freshness SLA, owner) and generate the tests that enforce it in the pipeline. Also when the user asks for data quality rules, schema…