Overview
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
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()
Next Steps¶
- Read the Getting Started guide.
- Browse the Usage examples.
- Dive into the API Reference.
Feel free to open issues or PRs with suggestions or improvements.