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.2.tar.gz (16.0 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.2-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lotad-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e66f9461065c0eb5f890cf7a521b2be6846facc68468c30a7800f0cbd5715962
MD5 b76de2eaa79d5d63906b3a0a251e2552
BLAKE2b-256 3fd994563655fc12670b26a8d2ab842df445294f0a7465e45f9295b13e4bfb73

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lotad-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4009bdc262f19b530d443b6ccfd4db12da9e835f2110912a9dcea71c372a10b6
MD5 024a7e4146a5a19b3bcaa67a4a1ae27f
BLAKE2b-256 dc4c4dff81d7f98e2ef9ffbd3171a61fe8b8ac502f4e79f4927c85d6207e70f3

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