DataComPy
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 (via snowpark)
- Dask (via Fugue)
- DuckDB (via Fugue)
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[fugue]
pip install datacompy[snowflake]
Legacy Spark Deprecation
With version v0.12.0 the original SparkCompare was replaced with a
Pandas on Spark implementation. The original SparkCompare implementation differs
from all the other native implementations. To align the API better, and keep behaviour
consistent we are deprecating the original SparkCompare into a new module LegacySparkCompare
Subsequently in v0.13.0 a PySpark DataFrame class has been introduced (SparkSQLCompare)
which accepts pyspark.sql.DataFrame and should provide better performance. With this version
the Pandas on Spark implementation has been renamed to SparkPandasCompare and all the spark
logic is now under the spark submodule.
If you wish to use the old SparkCompare moving forward you can import it like so:
from datacompy.spark.legacy import LegacySparkCompare
SparkPandasCompare Deprecation
Starting with v0.14.1, SparkPandasCompare is slated for deprecation. SparkSQLCompare is the prefered and much more performant.
It should be noted that if you continue to use SparkPandasCompare that numpy 2+ is not supported due to dependency issues.
Supported versions and dependncies
Different versions of Spark, Pandas, and Python interact differently. Below is a matrix of what we test with. With the move to Pandas on Spark API and compatability issues with Pandas 2+ we will for the mean time note support Pandas 2 with the Pandas on Spark implementation. Spark plans to support Pandas 2 in Spark 4
| Spark 3.2.4 | Spark 3.3.4 | Spark 3.4.2 | Spark 3.5.1 | |
|---|---|---|---|---|
| Python 3.10 | ✅ | ✅ | ✅ | ✅ |
| Python 3.11 | ❌ | ❌ | ✅ | ✅ |
| Python 3.12 | ❌ | ❌ | ❌ | ❌ |
| Pandas < 1.5.3 | Pandas >=2.0.0 | |
|---|---|---|
Compare |
✅ | ✅ |
SparkPandasCompare |
✅ | ❌ |
SparkSQLCompare |
✅ | ✅ |
| Fugue | ✅ | ✅ |
Supported backends
- Pandas: (See documentation)
- Spark: (See documentation)
- Polars: (See documentation)
- Snowflake/Snowpark: (See documentation)
- Fugue is a Python library that provides a unified interface for data processing on Pandas, DuckDB, Polars, Arrow, Spark, Dask, Ray, and many other backends. DataComPy integrates with Fugue to provide a simple way to compare data across these backends. Please note that Fugue will use the Pandas (Native) logic at its lowest level (See documentation)
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.
Roadmap
Roadmap details can be found here
Metadata
Release files for datacompy 0.16.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datacompy-0.16.5.tar.gz | 91.5 kB | Without provenance | Details for datacompy-0.16.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datacompy-0.16.5-py3-none-any.whl | Python 3 | none | any | Details for datacompy-0.16.5-py3-none-any.whl |
Total release size: 167.6 kB
Release files / datacompy-0.16.5.tar.gz
| Download URL | datacompy-0.16.5.tar.gz |
|---|---|
| Size | 91.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b06648cc271cd6a172efc4717177ff50a49814cb36a2c72c9b5b1d56dbdba0a2
|
|
BLAKE2b-256 checksum How to use checksums |
070e18fb049548bcc498da7ee39356ea6447bb86183256cade63db7e216df11a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Release files / datacompy-0.16.5-py3-none-any.whl
| Download URL | datacompy-0.16.5-py3-none-any.whl |
|---|---|
| Size | 76.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9d842fbb39eff3db5292c2e4e3181b0ecdacad47e78ab291d5cc3bd3f27e11e
|
|
BLAKE2b-256 checksum How to use checksums |
6cbb4eec563b7262acbd37b4f00b00d50b3d5f1e273d2fdd1ed82ed1846d0109
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Security for datacompy 0.16.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.