From ffaa75afeeae28564de9ccb39e61e573a45c46f1 Mon Sep 17 00:00:00 2001 From: Aaron Tacke Date: Thu, 15 Aug 2024 20:12:11 +0200 Subject: [PATCH 1/4] Add short description and example to readme --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50700a9..9b2cb27 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,24 @@ [![pypi-version](https://img.shields.io/pypi/v/tabulardelta.svg?logo=pypi&logoColor=white&style=flat-square)](https://pypi.org/project/tabulardelta) [![python-version](https://img.shields.io/pypi/pyversions/tabulardelta?logoColor=white&logo=python&style=flat-square)](https://pypi.org/project/tabulardelta) -Simplify table comparisons. +TabularDelta simplifies the comparison of diverse tables, like SQL tables or Pandas DataFrames. It can both find small deviations in largely similar tables, as well as provide an overview of more structural changes. + +To compare two tables, first select a comparator that supports the table format. Now select any formatter that best suits your use case to obtain a visualization of the result. + +## Usage example + +```python +import pandas as pd +from tabulardelta import PandasComparator, DetailedTextFormatter + +df_old = pd.read_csv("week24.csv", index_col=[0, 1]) +df_new = pd.read_csv("week25.csv", index_col=[0, 1]) + +delta = PandasComparator().compare(df_old, df_new) +print(DetailedTextFormatter().format(delta)) +``` + +To find more examples and get started, please visit the [documentation](https://tabulardelta.readthedocs.io/en/latest/). ## Development @@ -18,7 +35,6 @@ cd tabulardelta pixi run pre-commit-install pixi run postinstall -pixi run test ``` ## Testing From a39b6dc32d4d1134f83ec83aeb01fe3dce95ffb6 Mon Sep 17 00:00:00 2001 From: Aaron Tacke Date: Thu, 15 Aug 2024 20:25:25 +0200 Subject: [PATCH 2/4] Add link to test_docs_examples.py, where the example can be executed --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9b2cb27..20fd157 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ To compare two tables, first select a comparator that supports the table format. ## Usage example +This snippet will report the differences of two CSV files. +You can execute it directly in [test_docs_examples.py](tests/test_docs_examples.py). + ```python import pandas as pd from tabulardelta import PandasComparator, DetailedTextFormatter From a2ffa79f61a947a84f3b279769af08bed8038001 Mon Sep 17 00:00:00 2001 From: AaronTackeQC <156931896+AaronTackeQC@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:18:16 +0200 Subject: [PATCH 3/4] Update README.md with Dominik's suggestion Co-authored-by: DominikZuercherQC <115215632+DominikZuercherQC@users.noreply.github.com> --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 20fd157..44c9b79 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,11 @@ [![pypi-version](https://img.shields.io/pypi/v/tabulardelta.svg?logo=pypi&logoColor=white&style=flat-square)](https://pypi.org/project/tabulardelta) [![python-version](https://img.shields.io/pypi/pyversions/tabulardelta?logoColor=white&logo=python&style=flat-square)](https://pypi.org/project/tabulardelta) -TabularDelta simplifies the comparison of diverse tables, like SQL tables or Pandas DataFrames. It can both find small deviations in largely similar tables, as well as provide an overview of more structural changes. +TabularDelta helps to automate and simplify the often tedious and manual process of comparing relational data. +The TabularDelta protocol defines a representation of the differences between two tables. +"Comparators" are used to generate such a representation from two table objects. The exchangeability of the comparators allows for varying table input formats like SQL tables or Pandas DataFrames. +"Formatters" allow to present the differences in different output formats depending on the desired usecase. +The flexibility in the output format allows to find small deviations in largely similar tables or provide an overview of more structural changes. To compare two tables, first select a comparator that supports the table format. Now select any formatter that best suits your use case to obtain a visualization of the result. From 71e4977d49aef0aea94c47a1af676f1008f3192b Mon Sep 17 00:00:00 2001 From: Aaron Tacke Date: Fri, 16 Aug 2024 17:21:44 +0200 Subject: [PATCH 4/4] Update README.md with Dominik's suggestion (2) --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 44c9b79..415954d 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,12 @@ [![python-version](https://img.shields.io/pypi/pyversions/tabulardelta?logoColor=white&logo=python&style=flat-square)](https://pypi.org/project/tabulardelta) TabularDelta helps to automate and simplify the often tedious and manual process of comparing relational data. -The TabularDelta protocol defines a representation of the differences between two tables. + +The so-called TabularDelta protocol defines a representation of the differences between two tables. "Comparators" are used to generate such a representation from two table objects. The exchangeability of the comparators allows for varying table input formats like SQL tables or Pandas DataFrames. "Formatters" allow to present the differences in different output formats depending on the desired usecase. The flexibility in the output format allows to find small deviations in largely similar tables or provide an overview of more structural changes. -To compare two tables, first select a comparator that supports the table format. Now select any formatter that best suits your use case to obtain a visualization of the result. - ## Usage example This snippet will report the differences of two CSV files. @@ -29,6 +28,8 @@ delta = PandasComparator().compare(df_old, df_new) print(DetailedTextFormatter().format(delta)) ``` +To compare two tables, first select a comparator that supports the table format. Now select any formatter that best suits your use case to obtain a visualization of the result. + To find more examples and get started, please visit the [documentation](https://tabulardelta.readthedocs.io/en/latest/). ## Development