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 and columns with regex support

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.1.tar.gz (15.7 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.1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lotad-0.1.1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for lotad-0.1.1.tar.gz
Algorithm Hash digest
SHA256 345fd53a828bd2089600ad47fe35d9fe29c7ad3d4ef2976cef0bdb575273205b
MD5 d0c7501336694c3b802bbe7d16f5423d
BLAKE2b-256 f01e2524c2305f7975fb96081bdf0efae303ef930df4ae54b5c69b915249080e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lotad-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for lotad-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2176bdf6a7c9a83c28abc5cdaf6960ba3307e709d388c690c7b23ac8ca554459
MD5 590623dea633be88845559ced270f70e
BLAKE2b-256 c31dcd1f7565cd36d61defeade95779ce7c72513a8287ec168f9b1d92c5b07e2

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