Skip to main content

Developer-first data quality engine

Project description

Kontra

Data quality validation for developers.

Kontra validates datasets against declarative contracts. Define rules in YAML, run them against Parquet, CSV, PostgreSQL, or SQL Server. Get violation counts back.

pip install kontra

30-Second Example

# Profile your data
kontra profile data.parquet

# Draft a starting contract
kontra profile data.parquet --draft > contract.yml

# Validate
kontra validate contract.yml

Output:

PASSED - data.parquet (4 rules)
  COL:user_id:not_null      ✓
  COL:email:unique          ✓
  COL:status:allowed_values ✓
  COL:age:range             ✓

What You Write

# contract.yml
name: users_quality
datasource: data/users.parquet

rules:
  - name: not_null
    params: { column: user_id }

  - name: unique
    params: { column: email }

  - name: allowed_values
    params:
      column: status
      values: [active, inactive, pending]

What You Get

  • 13 built-in rules: not_null, unique, range, regex, freshness, and more
  • Fast execution: Metadata analysis and SQL pushdown before loading data
  • Multiple sources: Parquet, CSV, PostgreSQL, SQL Server, S3
  • Python API: Use as a library with kontra.validate(df, rules=[...])
  • State tracking: Compare runs over time with kontra diff

Documentation

Doc Audience
Getting Started New users
Python API Library users
Rules Reference Everyone
Configuration Project setup
Advanced Topics Agents, state, execution model
Architecture Contributors

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kontra-0.5.1.tar.gz (318.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kontra-0.5.1-py3-none-any.whl (281.6 kB view details)

Uploaded Python 3

File details

Details for the file kontra-0.5.1.tar.gz.

File metadata

  • Download URL: kontra-0.5.1.tar.gz
  • Upload date:
  • Size: 318.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for kontra-0.5.1.tar.gz
Algorithm Hash digest
SHA256 cdbf97968651f774a210ebdd9ed8b69e10c44d08fee9b0c59c60da2e41177cbe
MD5 8c8a03fc54742805a2a628508802859a
BLAKE2b-256 2159a06ad9ddc8852579c8bcf86ca17e1c981d6ab91efc26a2ba8e99ab135f3a

See more details on using hashes here.

File details

Details for the file kontra-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: kontra-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 281.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for kontra-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5fccc3db822e140dfe494d62851dee27aa3f0e351be1632ac1fdd73e17878bc
MD5 5c599743b33a77c7d512c7ed9e7f2582
BLAKE2b-256 9c3f471896ee5058f91c3299c1699152b6b50ed4cd21fb3090d0294e9e1e46e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page