Skip to main content

datapact - pytest, but for dataframes

All Contributors

codecov Pypi Test

datapact is a Python library for verifying your data.

import datapact

dp = datapact.test(df)

dp.age.must.be_positive()
dp.name.should.not_be_empty()

It works with Pandas + Dask DataFrames, and has special support for Jupyter Notebooks.

jupyter notebooks screenshot

Here's some features:

  • dozens of existing assertions, easy to add your own
  • great in-editor documentation via docstrings + types
  • two severence levels (.should for warnings, .must for failures)
  • failure notifications via E-Mail, MS Teams, Slack or PagerDuty (via Datapact Track)

Get Started here: https://datapact.dev

Datapact Track

Datapact Track is an optional, browser-based data tracking service.

Datapact Track dataset overview. code snippet for how to connect test suite to service

It's fully self-hostable via Docker and Postgres, and there's a hosted version available at track.datapact.dev.

Connecting your test suite is one line of code:

dp.connect(
  server="track.datapact.dev",
  token="..." # get this from the UI
)

Datapact track gives you:

  • notifications via E-Mail, Slack, MS Teams and PagerDuty
  • a central documentation of your datasets
  • history of data expectations + reality
  • data quality tracking

Try out Datapact Track at track.datapact.dev, or follow the self-hosting guide to deploy your own instance.

datapact vs Great Expectations

Both datapact and Great Expectations help you improve Data Quality, but with a different approach.

Great Expectations has its own JSON-based storage format for expectation suites, and it gives you a custom UI to edit them. It's way bigger than datapact - in project size, project scope, but also in complexity.

datapact is a lot younger, community-run, and more of a library than a framework. The main differentiator is that it allows you to express your test suites in Python code, right along your other code. This works in Python Scripts, Jupyter Notebooks, Pipeline Tests - everywhere that Python runs. And by having your tests in code, you can co-locate them with the rest of your code, and version control + review them just like all of it.

If you already know how to use Great Expectations, you should use it. If you found its learning curve to steep, maybe look at datapact - it's designed to be easy to get started, and intuitive to use.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Simon Knott

💻 📖 🤔 🚧

st-sch

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

Metadata

Release files for datapact 0.9.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 datapact 0.9.0
File Size Uploaded Provenance
datapact-0.9.0.tar.gz 220.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 438.4 kB

Release files / datapact-0.9.0.tar.gz

Download URL datapact-0.9.0.tar.gz
Size 220.0 kB
Tags Source
SHA-256 checksum
How to use checksums
95a45d98cd6a9c9d387871c67aeb0e315fe453055f908abd1476a845d50c6375
BLAKE2b-256 checksum
How to use checksums
7d8320bf6a6bbea895cf6aac2a142e2f05960f7e13bc094383f4e7d6b11faf99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / datapact-0.9.0-py3-none-any.whl

Download URL datapact-0.9.0-py3-none-any.whl
Size 218.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a735ac68ffc40a3d3d58decac81f1480563e5e7929033d9d8b30efe5d3b43ad
BLAKE2b-256 checksum
How to use checksums
4afa565be0b6c6b7ead62426ed60a94717b107b7bea5de0e8b5dabda6bcdd80d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for datapact 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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