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.0.tar.gz (312.8 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.0-py3-none-any.whl (278.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kontra-0.5.0.tar.gz
  • Upload date:
  • Size: 312.8 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.0.tar.gz
Algorithm Hash digest
SHA256 30d0b5583062773fa058cc0da6e6b24955f87945459ab0dec870d07f884c3bf5
MD5 a3305b1ab6c1b8e470c964d464f0f1bb
BLAKE2b-256 bce1a397c38ccac95532804a8804ce069796e04d28f8492998b9d641ec69c9c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kontra-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 278.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06b12110d9f39d605f9afe3bea2893cc39f4c1b4026d41f7c1b1ccff325fc644
MD5 dc54da9b63b4ab792c313700d755102c
BLAKE2b-256 f497a6b39f1beae8011b50dc92ceeb27a7a3ac5e8d36ebbdf9fb7f0767e39f74

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