Skip to main content

Add your description here

Project description

ddrift analyzes the differences between data sources, i.e. how much has dataset a drifted from dataset b. The framework is engine agnostic. Each engine is required to comply with simple abstract protocols in order to enable the standard reporting.

Engines Supported:

  • DuckDB
  • Postgres

Engines to be Supported:

  • Narwhals dispatches

Install with pip install ddrift or (prefferebly) uv pip install ddrift

Getting Started

Let's create 2 simple tables and compare them to one another. The fundamental question we're asking is "How much has table2 drifted from table1?"

import duckdb

with duckdb.connect() as con:
    con.execute("CREATE TABLE table1 (city VARCHAR, state VARCHAR)")
    con.execute(
        "INSERT INTO table1 VALUES ('New York', 'NY'), ('Los Angeles', 'CA'), ('Chicago', 'IL')"
    )

    con.execute("CREATE TABLE table2 (city VARCHAR, state VARCHAR)")
    con.execute(
        "INSERT INTO table2 VALUES ('New York', 'NY'), ('Phoenix', 'AZ'), ('Philadelphia', 'PA')"
    )

    sql = SQLComparator(df1="table1", df2="table2", con=con)
    sql.comp_freq(vars=("city", "state"))

    comp.compile_report()  # prints reports to console

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

drift_scope-0.0.3.tar.gz (40.0 kB view details)

Uploaded Source

Built Distribution

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

drift_scope-0.0.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file drift_scope-0.0.3.tar.gz.

File metadata

  • Download URL: drift_scope-0.0.3.tar.gz
  • Upload date:
  • Size: 40.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for drift_scope-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a25793dac8a7fb484e55d4cb0d40a2ab2794eb56743629a9298b74be121310db
MD5 45edf49aa9eff680bebc85171acad59a
BLAKE2b-256 8604255c558eb39828ccef8cadf6f703eda770e52e06b47477d22b61e2276c30

See more details on using hashes here.

File details

Details for the file drift_scope-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for drift_scope-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a7890210218efa853cb181706a392993d2650f51d04d96fd0cf8d82847e967fe
MD5 1b47ed846c628bcd60fe23c2dd423dec
BLAKE2b-256 822187812a5b8b3b9a0ef811792d701aaedc920d1fac1745399b669ad88fa19c

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