Skip to main content

Yet another data diff

Project description

diffolars

A small Polars-based toolkit for comparing two versions of a dataframe and generating randomized test data to exercise that comparison.

Ideally used to compare dataloads in the day-to-day of a database analyst.

Installation

uv add diffolars

Generating test data

diffolars.demo generates a random dataframe and a mutated copy of it, useful for testing diff logic without hand-crafting fixtures.

from diffolars.demo import get_df_pair

pair = get_df_pair(
    n_rows=100,
    n_cols=10,
    n_new_rows=5,    # rows added in the mutated copy
    n_new_cols=2,    # columns added in the mutated copy
    coverage=0.1,    # fraction of existing cells randomly changed
    seed=42,
)

original = pair["original"]
mutated = pair["mutated"]

Every generated row gets a record_id UUID column, used to match rows between the original and mutated dataframes. get_random_data and get_mutated_data are also available individually if you want to generate or mutate a dataframe on its own.

Diffing

diffolars.diff will define the comparison API (row/column intersection and symmetric difference, schema comparison) and is under active development...

Currently only the Windows build is available.

License

MIT — see LICENSE.

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

diffolars-0.2.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffolars-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file diffolars-0.2.0.tar.gz.

File metadata

  • Download URL: diffolars-0.2.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for diffolars-0.2.0.tar.gz
Algorithm Hash digest
SHA256 232aa37478997835d61b429011b0c484c7f0511cfb8b63c09e4e5d6cc2f76c5d
MD5 a13d8f58308b73e696c1449a1b50fbe5
BLAKE2b-256 606717d9e96b934bc102a56fb2ff619ca15293f3c4c27f241d9e7a05c26521f7

See more details on using hashes here.

File details

Details for the file diffolars-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: diffolars-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for diffolars-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc0fd0ac477f6ecc181c3f46f609f9388ef0adcb999633103bde2733bc2847f1
MD5 0021b1a7fa9d3166b22e00dc7530887a
BLAKE2b-256 05addd25f2eca1f7deb4feef661090a34028333968afdf8f26ad398dca584faa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page