datacompy 1.0.4


pip install datacompy

  Latest version

Released: Jul 30, 2026


Meta
Author: Faisal Dosani, Jacob Dawang, Raymond Haffar
Maintainer: Faisal Dosani, Jacob Dawang, Raymond Haffar
Requires Python: >=3.10.0

Classifiers

Intended Audience
  • Developers

Natural Language
  • English

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3 :: Only
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

DataComPy

PyPI - Python Version Ruff PyPI version Anaconda-Server Badge PyPI - Downloads

DataComPy is a package to compare two DataFrames (or tables) such as Pandas, Spark, Polars, and even Snowflake. Originally it was created to be something of a replacement for SAS's PROC COMPARE for Pandas DataFrames with some more functionality than just Pandas.DataFrame.equals(Pandas.DataFrame) (in that it prints out some stats, and lets you tweak how accurate matches have to be). Supported types include:

  • Pandas
  • Polars
  • Spark
  • Snowflake

[!IMPORTANT] datacompy has released v1. The v0.19.x line is no longer supported โ€” users should upgrade to v1 going forward. The support/0.19.x branch is archived and will only receive critical security fixes on a best-effort basis; no new features or regular maintenance will be provided. All active development targets main.

Quick Installation

pip install datacompy

or

conda install datacompy

Installing extras

If you would like to use Spark or any other backends please make sure you install via extras:

pip install datacompy[spark]
pip install datacompy[snowflake]

Supported backends

Programmatic Report Access

Every compare object exposes build_report_data() which returns a typed ReportData object โ€” useful for dashboards, JSON export, or custom rendering without relying on the string report:

import pandas as pd
from datacompy import PandasCompare

df1 = pd.DataFrame({"id": [1, 2, 3], "val": [10, 20, 30]})
df2 = pd.DataFrame({"id": [1, 2, 3], "val": [10, 99, 30]})

compare = PandasCompare(df1, df2, join_columns="id")

# Access structured data directly
data = compare.build_report_data()
print(data.row_summary.unequal_rows)  # 1
print(data.mismatch_stats.stats[0].column)  # 'val'

# Render / export โ€” methods live on ReportData itself
print(data.render())  # same text as compare.report()
data.save("report.html")  # HTML file
data.to_dict()  # JSON-serializable dict

See the Report API documentation for the full reference.

Contributors

We welcome and appreciate your contributions! Before we can accept any contributions, we ask that you please be sure to sign the Contributor License Agreement (CLA).

This project adheres to the Open Source Code of Conduct. By participating, you are expected to honor this code.

1.0.4 Jul 30, 2026
1.0.3 Jul 29, 2026
1.0.2 Jun 12, 2026
1.0.1 Jun 05, 2026
1.0.0 May 25, 2026
1.0.0b4 May 20, 2026
1.0.0b3 May 11, 2026
1.0.0b2 Mar 12, 2026
1.0.0b1 Mar 11, 2026
1.0.0a5 Feb 20, 2026
1.0.0a4 Jan 05, 2026
1.0.0a3 Dec 18, 2025
1.0.0a2 Dec 16, 2025
1.0.0a1 Nov 24, 2025
0.19.5 Apr 02, 2026
0.19.4 Mar 12, 2026
0.19.3 Mar 11, 2026
0.19.2 Jan 09, 2026
0.19.1 Dec 16, 2025
0.19.0 Nov 14, 2025
0.18.1 Oct 03, 2025
0.18.0 Aug 27, 2025
0.17.1 Jul 25, 2025
0.17.0 Jul 09, 2025
0.16.8 Jun 20, 2025
0.16.7 May 21, 2025
0.16.6 Apr 22, 2025
0.16.5 Apr 15, 2025
0.16.4 Mar 14, 2025
0.16.3 Feb 21, 2025
0.16.2 Feb 12, 2025
0.16.1 Feb 05, 2025
0.16.0 Jan 10, 2025
0.15.0 Dec 17, 2024
0.14.4 Nov 06, 2024
0.14.3 Oct 30, 2024
0.14.2 Oct 30, 2024
0.14.1 Oct 24, 2024
0.14.0 Oct 16, 2024
0.13.3 Sep 11, 2024
0.13.2 Jul 10, 2024
0.13.1 Jun 22, 2024
0.13.0 Jun 21, 2024
0.12.1 May 23, 2024
0.12.0 May 01, 2024
0.11.3 Mar 25, 2024
0.11.2 Mar 19, 2024
0.11.1 Mar 12, 2024
0.11.0 Feb 21, 2024
0.10.5 Nov 15, 2023
0.10.4 Sep 25, 2023
0.10.3 Aug 15, 2023
0.10.2 Jun 19, 2023
0.10.1 Jun 02, 2023
0.10.0 Jun 02, 2023
0.9.0 May 11, 2023
0.8.4 Jan 04, 2023
0.8.3 Nov 02, 2022
0.8.2 Oct 19, 2022
0.8.1 Apr 19, 2022
0.8.0 Mar 02, 2022
0.7.3 Oct 25, 2021
0.7.2 Feb 11, 2021
0.7.1 Jul 21, 2020
0.7.0 Jun 09, 2020
0.6.0 Jan 25, 2019
0.5.2 Jan 23, 2019
0.5.1 May 19, 2018
0.5.0 Mar 28, 2018

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
jinja2 (>=3)
numpy (<2.6,>=1.26.4)
ordered-set (<=4.1,>=4.0.2)
pandas (<3.1,>=2.2)
polars[pandas] (<1.44,>=0.20.4)