Lotad helps you identify schema changes, data differences, and structural modifications between database versions.
Project description
lotad
A Python library for tracking and analyzing data drift between DuckDB databases. Lotad helps you identify schema changes, data differences, and structural modifications between database versions.
Features
- Compare table schemas and data between two DuckDB databases
- Track missing tables, columns, and type mismatches
- Analyze row-level data differences using consistent hashing
- Generate detailed comparison reports
- Configurable tracking with support for excluding specific tables and columns
Installation
pip install lotad
Quick Start
from lotad import DatabaseComparator
# Initialize comparator with database paths
comparator = DatabaseComparator('path/to/db1.db', 'path/to/db2.db')
# Run full comparison
results = comparator.compare_all()
# Generate comparison report
comparator.generate_comparison_report(results, 'comparison_report.txt')
Basic Usage
Compare specific tables while ignoring others:
# Compare only specified tables
results = comparator.compare_all(tables=['users', 'orders'])
# Exclude specific tables from comparison
results = comparator.compare_all(ignore_tables=['logs', 'temp_data'])
Access detailed comparison results:
# Get schema differences
schema_diff = comparator.compare_table_schemas('users')
print(f"Missing columns in DB2: {schema_diff['missing_in_db2']}")
print(f"Type mismatches: {schema_diff['type_mismatches']}")
# Compare table data
data_diff = comparator.compare_table_data('orders')
print(f"Row count difference: {data_diff['row_count_diff']}")
## License
This project is licensed under the MIT License.
## Why Lotad?
Named after the water lily Pokémon, Lotad helps you stay afloat in a sea of database changes by tracking data drift between your DuckDB instances.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lotad-0.0.1.tar.gz.
File metadata
- Download URL: lotad-0.0.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e09768faf2ffb468d4e722302760f1dd358d35984623860cdbc3fcd35ae79040
|
|
| MD5 |
b05138c8f88900547cbf4ee9076e1d5d
|
|
| BLAKE2b-256 |
163c3d9a634b95face61dc88164968033bcb001ea147b53968c8b79e459ac5db
|
File details
Details for the file lotad-0.0.1-py3-none-any.whl.
File metadata
- Download URL: lotad-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f681497122c1e68cb04f3c797659802113fdaa22f1a2ee6a51e0f45db0d7c1ba
|
|
| MD5 |
c7a35c4b70749dc7869f53076ed516c5
|
|
| BLAKE2b-256 |
5da292da06368e72bb7fd52d2069de9c45d4ea607fd576f4b93b6beeedc2b0d8
|