Skip to main content

duckcheck

Lightweight data quality checks powered by DuckDB — the anti–Great Expectations for teams who want pip install, one YAML file, and one command.

License: MIT Python 3.11+ CI

Status: v0.5 — CSV/Parquet/SQLite sources, custom SQL with field substitution + expect, pattern regex, freshness, baselines, JUnit, and --format json.

60-second try

docker compose run --rm run-example  # duckcheck run examples/clean.yaml
docker compose run --rm test         # pytest

Why this vs alternatives

Approach Strength Gap
duckcheck One YAML + DuckDB, local files, CI-friendly Not a full observability platform
Great Expectations Rich ecosystem Heavyweight setup for simple column checks
Soda Core Familiar check DSL Cloud-oriented workflow
Ad-hoc SQL in CI Zero new tools No standard report / JUnit / baselines

Problem

Data teams need to assert column quality in CI, but Great Expectations is heavyweight and Soda Core funnels to cloud. Ad-hoc SQL checks have no reporting standard.

Key features (v0.5)

  • YAML check definitions
  • DuckDB scans CSV, Parquet, and SQLite locally — no server
  • Checks: not_null, unique, accepted_values, custom_sql, pattern, freshness, row_count, row_count_delta
  • custom_sql ${column} / ${name} substitution; expect operators: 0, =N, >N, <N, >=N, <=N (default 0)
  • --format json and --junit for CI dashboards
  • ${ENV} in source URIs; --source-table for SQL ATTACH

Architecture

duckcheck run checks.yaml
    └── SuiteSpec (Pydantic)
            └── DuckDB in-process
                    └── source_data view from CSV/Parquet
Component Technology Why
Engine DuckDB Single dependency, scans files + SQL databases
CLI Click + Rich Simple, good terminal UX
Spec YAML + Pydantic Version-controllable checks

Installation

pip install duckcheck
pip install -e ".[dev]"

Usage

duckcheck health
duckcheck run examples/clean.yaml
duckcheck run examples/checks.yaml   # fixture with known failures
duckcheck run examples/clean.yaml --junit /tmp/duckcheck.xml
duckcheck run examples/clean.yaml --format json
duckcheck baseline update examples/clean.yaml

Example checks.yaml:

name: sample-suite
source: examples/sample.csv
checks:
  - name: id_not_null
    type: not_null
    column: id
  - name: status_values
    type: accepted_values
    column: status
    values: [active, inactive]
  - name: three_active
    type: custom_sql
    sql: "SELECT * FROM source_data WHERE status = 'active'"
    expect: "=3"

Docker

docker compose run --rm test
docker compose run --rm run-example

Running tests

pytest tests/ -v

Roadmap

  • Freshness + row_count + custom_sql + JUnit
  • Row-count baseline delta store (duckcheck baseline update)
  • custom_sql expect operators + --format json
  • custom_sql ${column} / ${name} substitution + pattern checks
  • Live Postgres/MySQL ATTACH integration tests
  • Airflow/Dagster operators

License

MIT

Known limitations (v0.5)

  • Postgres/MySQL ATTACH is stubbed (INSTALL/LOAD) — no live DB in CI yet
  • examples/checks.yaml is a failing fixture; examples/clean.yaml is the happy path
  • Checks still run against a source_data view

Release files for duckcheck 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duckcheck 0.5.0
File Size Uploaded
duckcheck-0.5.0.tar.gz 20.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for duckcheck 0.5.0
File Interpreter ABI Platform
duckcheck-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size:30.6 kB

Release files / duckcheck-0.5.0.tar.gz

Download URL duckcheck-0.5.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
07f4b27d8985e7da5208409ede8c9e25367d3f35a6555be01af0911db9f54215
BLAKE2b-256 checksum
How to use checksums
d8aca7ca8c35a7b2e6ec187e6e6d7c57ec4a08de8933aa790811f3120cc4dccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / duckcheck-0.5.0-py3-none-any.whl

Download URL duckcheck-0.5.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba62b2ede8727b8ea85064307aebb84e4a21189f0a01cd0ec3619b01c578da43
BLAKE2b-256 checksum
How to use checksums
2ff9dfc598a358b56da4848173e2c875e1bafa4fb9c07b38924feb895e35e49f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

This release

0.5.0 This release

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page