🗂 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:
pixi add diffly
conda install diffly
uv 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.
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.4.1.tar.gz.
File metadata
- Download URL: diffly-1.4.1.tar.gz
- Upload date:
- Size: 265.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fcb852b83b20552155024989bbb55152850d1b1f359c3e207ecdaa8df47e554
|
|
| MD5 |
b3bb4245186200ff455dce0a81a13d6d
|
|
| BLAKE2b-256 |
6810ef4e941b6c101dbe2cf8331fec6b646ac40c3148e88c2e6b7370c762b95a
|
Provenance
The following attestation bundles were made for diffly-1.4.1.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.4.1.tar.gz -
Subject digest:
7fcb852b83b20552155024989bbb55152850d1b1f359c3e207ecdaa8df47e554 - Sigstore transparency entry: 2667327829
- Sigstore integration time:
-
Permalink:
Quantco/diffly@5f0a9e924dabd57ce51f662b3e651a8e1258c812 -
Branch / Tag:
refs/tags/v1.4.1 - Owner: https://github.com/Quantco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@5f0a9e924dabd57ce51f662b3e651a8e1258c812 -
Trigger Event:
release
-
Statement type:
File details
Details for the file diffly-1.4.1-py3-none-any.whl.
File metadata
- Download URL: diffly-1.4.1-py3-none-any.whl
- Upload date:
- Size: 37.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b02fbe15c4972c8ecde5c881f0431bee74ffabee92ae67198b66541351c359a4
|
|
| MD5 |
a704142298789e438171c77e55377f94
|
|
| BLAKE2b-256 |
720313a72328374df2157b7baadddd45723642ee9c77d4aa98e2ca07c8c44bff
|
Provenance
The following attestation bundles were made for diffly-1.4.1-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.4.1-py3-none-any.whl -
Subject digest:
b02fbe15c4972c8ecde5c881f0431bee74ffabee92ae67198b66541351c359a4 - Sigstore transparency entry: 2667327882
- Sigstore integration time:
-
Permalink:
Quantco/diffly@5f0a9e924dabd57ce51f662b3e651a8e1258c812 -
Branch / Tag:
refs/tags/v1.4.1 - Owner: https://github.com/Quantco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@5f0a9e924dabd57ce51f662b3e651a8e1258c812 -
Trigger Event:
release
-
Statement type: