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.
- 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
With pip:
pip install recxwith uv:
uv add recximport 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.