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.0.tar.gz (14.2 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.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lotad-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cf0ed1aa8906645f59d8d7d6b49f0556b9bdbe3dccdf20812a62d062c25d25bd
MD5 19431729b6a3f2965ca15f8c50efbebd
BLAKE2b-256 5e057dde43da83c3c9f24c8cd9b6c219144f6adc03077bdca80cdc90b312d981

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lotad-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60432f6e6a04030f1a9f6ba2bffc989feef99b1387ddf373a98b139e00a420e6
MD5 556c00cae0b91a0e2d3183afca32a202
BLAKE2b-256 a960565bad5890eee4d859037809e2140bb26bc5a72ed9ec6ca92cd7c54968c2

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