tabval performs data validation of tabular data using Pydantic.
-
Add CSV file to be tested to
datafolder, e.g.small.csv -
Add the user defined Pydantic model to
src/models/models.py- Possibly add user defined validator functions (including tests) to be used in BeforeValidator and AfterValidator (annotated types)
- Add types and annotated types to the Pydantic model
-
Adjust
tabval.py- Import the relevant Pydantic model from
src/models/models.py - Update the object passed to the
Reportcontext manager- Reference the Pydantic model in
model - Reference the CSV data in
srcas a string (relative path)
- Reference the Pydantic model in
- Import the relevant Pydantic model from
-
Perform the validation with uv:
uv run -m tabval
-
Add the user defined Pydantic model to
src/models/models.py- Possibly add user defined validator functions (including tests) to be used in BeforeValidator and AfterValidator (annotated types)
- Add types and annotated types to the Pydantic model
-
Adjust
tabval.py- Import the relevant Pydantic model from
src/models/models.py - Update the object passed to the
Reportcontext manager- Reference the Pydantic model in
model - Reference the in-memory pandas DataFrame in
src
- Reference the Pydantic model in
- Import the relevant Pydantic model from
-
Perform the validation with uv:
uv run -m tabval
Unit and integration testing with pytest. Execute tests with uv run pytest.
Add support for other tabular data formats such as Polars and Excel.