Skip to main content

lotad

A Python library for tracking data drift between DuckDB databases. Helps identify schema changes, differences in data, and structural modifications between versions. Built as an exploratory tool with minimal setup required. Particularly useful for assessing downstream pipeline impacts.

Features

  • Compare schemas and data between DuckDB databases
  • Write changes to dedicated tables matching original schemas for easy visualization
  • No primary key requirement
  • Support for string-encoded and url-encoded JSON sorting
  • Detect missing tables, columns and type mismatches
  • Analyze row differences with consistent hashing
  • Generate detailed comparison reports
  • Configure excluded/included tables with regex support
  • Specify excluded columns for each table

Quick Start

Install

Must be 3.12+

pip install lotad

How to use

# Create a config file to quickly re-run the same diff check on 2 databases
lotad setup

# Or pass in the config to make changes via the wizard
# Alternatively, you can just alter the config directly
lotad setup --config lotad_config.yaml

# To perform the diff check
lotad run --config lotad_config.yaml

# Or you can pass in a subset of the config params directly to the run command.
lotad run --help

Checking results

A DuckDB file is created in the path set in the config but defaults to drift_analysis.db in the current directory if not set in the config.

For each table with data drift a table will be created within it. The generated table will contain the combined schema of the 2 dbs plus the following metadata columns generated by lotad.

  • observed_in the db the row was in
  • hashed_row a hash based representation of the row excluding ignored columns

These tables will also be created which contain summary level information

  • lotad_db_data_drift_summary
  • lotad_missing_table_drift
  • lotad_table_schema_drift

License

This project is licensed under the MIT License.

Metadata

Release files for lotad 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lotad 0.2.1
File Size Uploaded
lotad-0.2.1.tar.gz 52.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lotad 0.2.1
File Interpreter ABI Platform
lotad-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 81.7 kB

Release files / lotad-0.2.1.tar.gz

Download URL lotad-0.2.1.tar.gz
Size 52.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8ce8ed96cb6e0a1b313b57178688d4491c2722cdc7bfcb5b8b44334866cd476b
BLAKE2b-256 checksum
How to use checksums
84082b0c786f3d9c06262d751932550e29706460ce3f0a35e49c3587e2670f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.6.9

Release files / lotad-0.2.1-py3-none-any.whl

Download URL lotad-0.2.1-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0145ae51fa4cb1cf0e30b12801d1c735c1c6fc2bfe91df2ac3dd425ff247ab0c
BLAKE2b-256 checksum
How to use checksums
aa6dd8658fd8bc7b978cb1188d7015fd12158f73794d0603e2b1da96531a6f77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.6.9

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page