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

  • 18 built-in rules: not_null, unique, range, regex, contains, length, 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.2.tar.gz (325.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.2-py3-none-any.whl (293.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kontra-0.5.2.tar.gz
  • Upload date:
  • Size: 325.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.2.tar.gz
Algorithm Hash digest
SHA256 7bdb7e156640a70731ca44cfeef2182b19a9c1091a0845f4d9246f5e848c9be4
MD5 abd18e3c11e5c8cd257e7e29f61067c2
BLAKE2b-256 3fc053ba905d657dcf478ff95a61eab5939cd796819067a8a567c37479acef20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kontra-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 293.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4794bbb89b632e87a9c7ec8e71b40e90dcd2224e4e543835e81eecf2a8f1adee
MD5 bd769fd8296e5ed582235d51e41da7fb
BLAKE2b-256 0609ae443e085a9d064c8af8fff7961552eef10180e6fda73fb222bddd154829

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