Lightweight reconciliation tests for DataFrames
Project description
Lightweight reconciliation tests for DataFrames
Use Rec to compare two DataFrames (baseline vs candidate) with per-column checks (equality, absolute / relative tolerance, regex-driven selection) and clear summaries of failures.
Features
- Declarative column mapping
- Built-in checks: equality, absolute tolerance, relative tolerance
- Index integrity checks (missing / extra index values)
- Regex column selection (
regex=Trueon checks) - Compact textual summary
- Extensible: implement custom checks by subclassing
ColumnCheck
Install
With pip:
pip install recx
with uv:
uv add recx
Quick Example
import pandas as pd
from recx import Rec, EqualCheck, AbsTolCheck
baseline = pd.DataFrame({
"price": [100.00, 200.00, 300.00],
"status": ["active", "inactive", "active"]
})
candidate = pd.DataFrame({
"price": [100.00, 200.00, 301.00],
"status": ["active", "inactive", "active"]
})
rec = Rec(columns={
"price": AbsTolCheck(tol=0.01),
"status": EqualCheck(),
})
result = rec.run(baseline, candidate)
result.summary()
Feel free to open issues or PRs with suggestions or improvements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
recx-0.0.7.tar.gz
(8.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
recx-0.0.7-py3-none-any.whl
(9.3 kB
view details)
File details
Details for the file recx-0.0.7.tar.gz.
File metadata
- Download URL: recx-0.0.7.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf84171f5fc29f8086f7448f9c71ae03d14cd9a0ac12256c9bc89fd369593f45
|
|
| MD5 |
47cef15d9489cdac3c0c56bcfae30b86
|
|
| BLAKE2b-256 |
3a2fa645258cc9a45b8662be5b753d12de83888351683596cbdf16df642bbc8a
|
File details
Details for the file recx-0.0.7-py3-none-any.whl.
File metadata
- Download URL: recx-0.0.7-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
680f9288b93a0356ad70d9ed0f45a5a7dc6f6dc531ec9c12afb75e17f4063d68
|
|
| MD5 |
6fbd7cde39f2c7d4f8ee7356038dce43
|
|
| BLAKE2b-256 |
158d3f4d154b35b6a00e8b86bde6c20f9918d8568b723fb33409aea7455f5dee
|