Skip to content
Back to search

datacompy

Pandas, Polars, Spark, and Snowpark DataFrame comparison for humans and more!

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/capitalone/datacompy with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/capitalone/datacompy'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/capitalone--datacompy/badge.svg)](/listings/capitalone--datacompy)

HTML

<a href="/listings/capitalone--datacompy"><img src="/api/listings/capitalone--datacompy/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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]

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 120 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # DataComPy
  2. ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/datacompy)
  3. [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
  4. [![PyPI version](https://badge.fury.io/py/datacompy.svg)](https://badge.fury.io/py/datacompy)
  5. [![Anaconda-Server Badge](https://anaconda.org/conda-forge/datacompy/badges/version.svg)](https://anaconda.org/conda-forge/datacompy)
  6. ![PyPI - Downloads](https://img.shields.io/pypi/dm/datacompy)
  7. DataComPy is a package to compare two DataFrames (or tables) such as Pandas, Spark, Polars, and
  8. even Snowflake. Originally it was created to be something of a replacement
  9. for SAS's ``PROC COMPARE`` for Pandas DataFrames with some more functionality than
  10. just ``Pandas.DataFrame.equals(Pandas.DataFrame)`` (in that it prints out some stats,
  11. and lets you tweak how accurate matches have to be). Supported types include:
  12. - Pandas
  13. - Polars
  14. - Spark (classic and Spark Connect)
  15. - Snowflake
  16. > [!IMPORTANT]
  17. > datacompy has released `v1`. The `v0.19.x` line is no longer supported — users should upgrade to `v1` going forward.
  18. > 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.
  19. > All active development targets `main`.
  20. ## Quick Installation
  21. ```shell
  22. pip install datacompy
  23. ```
  24. or
  25. ```shell
  26. conda install datacompy
  27. ```
  28. ### Installing extras
  29. If you would like to use Spark or any other backends please make sure you install via extras:
  30. ```shell
  31. pip install datacompy[spark]
  32. pip install datacompy[snowflake]
  33. ```
  34. ## Supported backends
  35. - Pandas: ([See documentation](https://capitalone.github.io/datacompy/pandas_usage.html))
  36. - Spark: ([See documentation](https://capitalone.github.io/datacompy/spark_usage.html))
  37. - Polars: ([See documentation](https://capitalone.github.io/datacompy/polars_usage.html))
  38. - Snowflake/Snowpark: ([See documentation](https://capitalone.github.io/datacompy/snowflake_usage.html))
  39. ## Command Line Interface
  40. DataComPy ships a `datacompy` command, so ad hoc checks and CI pipelines do not
  41. need a throw-away script ([see documentation](https://capitalone.github.io/datacompy/cli.html)):
  42. ```bash
  43. # Compare two files and print a report
  44. datacompy compare --left before.csv --right after.csv --on id
  45. # Fail a build on any difference, with a JSON report saved as an artifact
  46. datacompy compare \
  47. --left before.parquet --right after.parquet \
  48. --on account_id,as_of_date \
  49. --abs-tol balance=0.01 \
  50. --max-unequal-rows 0 \
  51. --report-format json --output reports/diff.json --quiet
  52. ```
  53. It exits `0` when the datasets match, `1` when they differ, and `2` on error.
  54. CSV, Parquet, and JSON inputs are supported on the pandas, polars, and Spark
  55. backends, including tab separated CSV via a `.tsv` extension, and Snowflake
  56. tables can be compared in place.
  57. ## Programmatic Report Access
  58. Every compare object exposes `build_report_data()` which returns a typed
  59. [`ReportData`](https://capitalone.github.io/datacompy/report_api.html) object
  60. — useful for dashboards, JSON export, or custom rendering without relying on
  61. the string report:
  62. ```python
  63. import pandas as pd
  64. from datacompy import PandasCompare
  65. df1 = pd.DataFrame({"id": [1, 2, 3], "val": [10, 20, 30]})
  66. df2 = pd.DataFrame({"id": [1, 2, 3], "val": [10, 99, 30]})
  67. compare = PandasCompare(df1, df2, join_columns="id")
  68. # Access structured data directly
  69. data = compare.build_report_data()
  70. print(data.row_summary.unequal_rows) # 1
  71. print(data.mismatch_stats.stats[0].column) # 'val'
  72. # Render / export — methods live on ReportData itself
  73. print(data.render()) # same text as compare.report()
  74. data.save("report.html") # HTML file
  75. data.to_dict() # JSON-serializable dict
  76. ```
  77. See the [Report API documentation](https://capitalone.github.io/datacompy/report_api.html) for the full reference.
  78. ## Contributors
  79. We welcome and appreciate your contributions! Before we can accept any contributions, we ask that you please be sure to
  80. sign the [Contributor License Agreement (CLA)](https://cla-assistant.io/capitalone/datacompy).
  81. To run the CI test matrix locally, including the Spark and Spark Connect tracks without a hand-managed JDK,
  82. see the [Developer Instructions](https://capitalone.github.io/datacompy/developer_instructions.html).
  83. This project adheres to the [Open Source Code of Conduct](https://developer.capitalone.com/resources/code-of-conduct/).
  84. By participating, you are expected to honor this code.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.