Skip to main content

CLI tool for schema tracking

Project description

Datatrack - Lightweight Schema Change Tracker

Datatrack is a minimal open-source CLI tool to track schema changes across versions in your data systems. It's built for Data Engineers and Platform Teams who want automated schema linting, verification, diffs, and export across snapshots.

Features

  • Snapshot schemas from any SQL-compatible DB
  • Lint schema naming issues
  • Enforce verification rules
  • Compare schema snapshots (diff)
  • Export to JSON/YAML for auditing or CI
  • Full pipeline in one command

Installation

Option 1: Install from GitHub (for development)

git clone https://github.com/nrnavaneet/datatrack.git
cd datatrack
pip install -r requirements.txt
pip install -e .

This method is ideal if you want to contribute or modify the tool.

Option 2: Install from PyPI (production use)

pip install dbtracker

This is the easiest and recommended way to use datatracker as a CLI tool in your workflows.

How to Use

1. Initialize Tracking

datatrack init

Creates .datatrack/, .databases/, and optional initial files.

2. Create Example SQLite DB (Optional)

import sqlite3
from pathlib import Path

Path(".databases").mkdir(parents=True, exist_ok=True)
conn = sqlite3.connect(".databases/example.db")
c = conn.cursor()
c.execute("CREATE TABLE users (id INTEGER, name TEXT, created_at TEXT)")
c.execute("CREATE TABLE orders (order_id INTEGER, user_id INTEGER, amount REAL)")
conn.commit()
conn.close()

3. Take a Schema Snapshot

datatrack snapshot --source sqlite:///.databases/example.db

4. Run Linter

datatrack lint

Warns if ambiguous names, overly generic types, etc.

5. Schema Verification

datatrack verify

By default reads rules from schema_rules.yaml in project root.

6. Show Schema Differences

datatrack diff

Compares latest 2 snapshots.

7. Export Snapshot or Diff

datatrack export --type snapshot --format json --output output/snapshot.json

datatrack export --type diff --format yaml --output output/diff.yaml

8. View Snapshot History

datatrack history

Lists snapshot filenames.

9. Run Full Pipeline

datatrack pipeline run --source sqlite:///.databases/example.db

This runs:

  • lint
  • snapshot
  • verify
  • diff
  • export

To change export location:

datatrack run --source sqlite:///.databases/example.db --export-dir my_output_dir

👤 Author

Built with ❤️ by @nrnavaneet

📝 License

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

datatrack_core-0.1.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

datatrack_core-0.1.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: datatrack_core-0.1.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for datatrack_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b209e5ce50a66170261ed60ef96916a9b98464f1192a99c01a7601fd73b1f321
MD5 afc5262a878f46c9521bb28f766b2fa8
BLAKE2b-256 e4ab01edf5d1c750622a9657f5c7bae7f20903e0661998f34d64018a1e15847c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: datatrack_core-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for datatrack_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 133c255207b53c8fdca25a2d07d361074de7be6ab6c6e9a4d3a5210d446c90ea
MD5 254addc64c9e2b00dd28c2000a743386
BLAKE2b-256 8c62e47e6ae1f783d3163820601e9b7cdfd5e79b63ac2cfc5aa9d11fd34fe797

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