Skip to main content

Simplify table comparisons.

Project description

TabularDelta

CI Documentation pypi-version python-version

TabularDelta helps to automate and simplify the often tedious and manual process of comparing relational data.

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.

Usage example

This snippet will report the differences of two CSV files. You can execute it directly in test_docs_examples.py.

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 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.

Development

This project is managed by pixi. You can install the package in development mode using:

git clone https://github.com/quantco/tabulardelta
cd tabulardelta

pixi run pre-commit-install
pixi run postinstall

Testing

  • Make sure docker is installed
  • Make sure ODBC Driver 17 for SQL Server is installed
  • Run pixi run test

Setting up the MsSql docker container may take a while, but it will be cached for future runs as long as you keep it running.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tabulardelta-1.1.0.tar.gz (405.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tabulardelta-1.1.0-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

Details for the file tabulardelta-1.1.0.tar.gz.

File metadata

  • Download URL: tabulardelta-1.1.0.tar.gz
  • Upload date:
  • Size: 405.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tabulardelta-1.1.0.tar.gz
Algorithm Hash digest
SHA256 190e2b774dca2b2d1a7e6dc9cc6b4540cfe90c0b51816b879822b4053c2b1cd0
MD5 77f5f14522e716408c5b2b08670ad89c
BLAKE2b-256 9ef7b665d76156b3321967ecc23e9c0217add691e9a604451a1d6b7c44a86467

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabulardelta-1.1.0.tar.gz:

Publisher: build.yml on Quantco/tabulardelta

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tabulardelta-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: tabulardelta-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tabulardelta-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4bb08e4735cd33e96050792cc34ab51995b2c2d44e15389edd8f144e8c20afb
MD5 86e4176f671c16fe0332ed76e9a7a16b
BLAKE2b-256 90061019b24db7ffae8f79604124727b40caa8a00dfddc16819c586365d47616

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabulardelta-1.1.0-py3-none-any.whl:

Publisher: build.yml on Quantco/tabulardelta

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page