Utility package for comparing polars dataframes.
Project description
๐ Table of Contents
๐ Introduction
Diffly is a Python package for comparing Polars DataFrames with detailed analysis capabilities. It identifies differences between datasets including schema differences, row-level mismatches, missing rows, and column value changes.
๐ฟ Installation
You can install diffly using your favorite package manager, e.g., pixi or pip:
pixi add diffly
pip install diffly
๐ฏ Usage
import polars as pl
from diffly import compare_frames
left = pl.DataFrame({
"id": ["a", "b", "c"],
"value": [1.0, 2.0, 3.0],
})
right = pl.DataFrame({
"id": ["a", "b", "d"],
"value": [1.0, 2.5, 4.0],
})
comparison = compare_frames(left, right, primary_key="id")
if not comparison.equal():
summary = comparison.summary(
top_k_column_changes=1,
show_sample_primary_key_per_change=True
)
print(summary)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Diffly Summary โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Primary key: id
Schemas
โโโโโโโ
Schemas match exactly (column count: 2).
Rows
โโโโ
Left count Right count
3 (no change) 3
โโโฏโโฏโโฏโโฏโโ
โ-โ-โ-โ-โ-โ 1 left only (33.33%)
โ โโผโโผโโผโโผโโจโโโโโโฏโโฏโโฏโโฏโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ โ โ โ โ = โ โ โ โ โ โ 1 equal (50.00%) โ
โ โโผโโผโโผโโผโโจโโโโ โโผโโผโโผโโผโโจโโโโโโโโโโโโโโโโโโโโโโโโโโโโโด 2 joined
โ โ โ โ โ โ โ โ โ โ โ โ โ 1 unequal (50.00%) โ
โโโทโโทโโทโโทโโโโโโ โโผโโผโโผโโผโโจโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ+โ+โ+โ+โ+โ 1 right only (33.33%)
โโโทโโทโโทโโทโโ
Columns
โโโโโโโ
โโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ value โ 50.00% โ 2.0 -> 2.5 (1x, e.g. "b") โ
โโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
See more examples in the documentation.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diffly-1.0.0.tar.gz.
File metadata
- Download URL: diffly-1.0.0.tar.gz
- Upload date:
- Size: 221.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eee2092c5e6aa402822312230018cf70e386ac8ec3c581cebf7bd58f7cbd15f7
|
|
| MD5 |
900a414446d1b14e08d9852234d0a6cf
|
|
| BLAKE2b-256 |
e00d5d9bca3977283653ef26e7ebbbc5b1e1f8467c2be57d6d3c875e1a7e49fc
|
Provenance
The following attestation bundles were made for diffly-1.0.0.tar.gz:
Publisher:
build.yml on Quantco/diffly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffly-1.0.0.tar.gz -
Subject digest:
eee2092c5e6aa402822312230018cf70e386ac8ec3c581cebf7bd58f7cbd15f7 - Sigstore transparency entry: 1003975502
- Sigstore integration time:
-
Permalink:
Quantco/diffly@6e2c8ea5afd0f2a67efeba0f6e99ccbb8497abc0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Quantco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@6e2c8ea5afd0f2a67efeba0f6e99ccbb8497abc0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file diffly-1.0.0-py3-none-any.whl.
File metadata
- Download URL: diffly-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13a5eb8e0ab9f46cf02859edbd22cd54cfd9b6d70851a2007c27c6e6865bcf30
|
|
| MD5 |
cc78e07550e4fae3ef35ba8736193b3d
|
|
| BLAKE2b-256 |
65fcf31285126a797a0447adb4403e41be380fd87c515825d4a4cdabf4e2f1d7
|
Provenance
The following attestation bundles were made for diffly-1.0.0-py3-none-any.whl:
Publisher:
build.yml on Quantco/diffly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffly-1.0.0-py3-none-any.whl -
Subject digest:
13a5eb8e0ab9f46cf02859edbd22cd54cfd9b6d70851a2007c27c6e6865bcf30 - Sigstore transparency entry: 1003975560
- Sigstore integration time:
-
Permalink:
Quantco/diffly@6e2c8ea5afd0f2a67efeba0f6e99ccbb8497abc0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Quantco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@6e2c8ea5afd0f2a67efeba0f6e99ccbb8497abc0 -
Trigger Event:
release
-
Statement type: