Skip to main content

Lotad helps you identify schema changes, data differences, and structural modifications between database versions.

Project description

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 --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.

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

lotad-0.1.4.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

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

lotad-0.1.4-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file lotad-0.1.4.tar.gz.

File metadata

  • Download URL: lotad-0.1.4.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.3

File hashes

Hashes for lotad-0.1.4.tar.gz
Algorithm Hash digest
SHA256 429981b60f09f9ed3a9a7fb2ea337911a2b29177b6ba6fc70836fc87bbf322dc
MD5 e43fd53c66824e38a3bc2b61d9c4df88
BLAKE2b-256 fb0805be554c456ca481bdf249e1a72f4758918bb9ffa74bedf79f2afcc32eb3

See more details on using hashes here.

File details

Details for the file lotad-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: lotad-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.3

File hashes

Hashes for lotad-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9764bc409eea038b613c2f95fcb237ad57588d8dbfb414e06c6a6a72aac2b5ee
MD5 90061a4e4a8faf0f50048d30e097b86b
BLAKE2b-256 8362e44dd9a607b3429d2fceab56e418e17c063037cba32cea36e7ee92609917

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