Tool for comparing and inspecting data in SQL databases.
Project description
SQLCompyre
SQLCompyre is a simple Python package that allows you to find and explore the differences between SQL tables, schemas, and entire databases. It provides both a Python interface and a CLI, allowing it to be used for both ad-hoc comparisons as well as in-depth analyses.
SQLCompyre is designed to be dialect-agnostic and should, thus, work with most database systems out-of-the-box.
Usage example
Given a connection to a database, this snippet will print a report of the differences between two tables:
import sqlalchemy as sa
import sqlcompyre as sc
engine = sa.create_engine("<your_connection_string>")
comparison = sc.compare_tables(engine, "<left table name>", "<right table name>")
report = comparison.summary_report()
print(report)
To find more examples and get started, please visit the documentation.
Installation
SQLCompyre can be installed via pip or conda:
pip install sqlcompyre
# or
micromamba install sqlcompyre
# or
conda install sqlcompyre
Details on its usage can be found in the documentation.
Development
This project is managed by pixi. You can install the package in development mode using:
git clone https://github.com/quantco/sqlcompyre
cd sqlcompyre
pixi run pre-commit-install
pixi run postinstall
Running Tests Locally
-
Make sure you have
msodbcsql18installed, or install it here -
Make sure you have
Dockerinstalled, or install it here -
Create a local test database with the following command:
docker compose up
- Set environment variable
export DB_CONNECTION_STRING="mssql+pyodbc://sa:Passw0rd@localhost:1435/master?driver=ODBC+Driver+18+for+SQL+Server&Encrypt=no"
- Navigate to the main directory of this repository and run pytest.
pixi run test
Project details
Release history Release notifications | RSS feed
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 sqlcompyre-2.0.0.tar.gz.
File metadata
- Download URL: sqlcompyre-2.0.0.tar.gz
- Upload date:
- Size: 116.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdca99a3ea7e5ef31b87243b0ae1334ddb31784a5577c92f6620c4d72c19d9a4
|
|
| MD5 |
7ef1ae0c93c8f0cea5652c47b73c9543
|
|
| BLAKE2b-256 |
28d92d0d48bf66438d1ed4fde152460ea44aea95f453747045ae99aad8d214bd
|
Provenance
The following attestation bundles were made for sqlcompyre-2.0.0.tar.gz:
Publisher:
build.yml on Quantco/sqlcompyre
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqlcompyre-2.0.0.tar.gz -
Subject digest:
cdca99a3ea7e5ef31b87243b0ae1334ddb31784a5577c92f6620c4d72c19d9a4 - Sigstore transparency entry: 163061440
- Sigstore integration time:
-
Permalink:
Quantco/sqlcompyre@4e8479479a010e8fdd5f4a12ce6c0278459e7045 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/Quantco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@4e8479479a010e8fdd5f4a12ce6c0278459e7045 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sqlcompyre-2.0.0-py3-none-any.whl.
File metadata
- Download URL: sqlcompyre-2.0.0-py3-none-any.whl
- Upload date:
- Size: 39.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1de861985aaf49b94856a519becb7fe75d87159486ec699d47b869efb7846d0b
|
|
| MD5 |
6d7a8ca946326359d2a842e028db6e5e
|
|
| BLAKE2b-256 |
20c5fdf9b0beca3754b3b8c63ae85a6ce79b52a73f70eac20802293dda18d5e4
|
Provenance
The following attestation bundles were made for sqlcompyre-2.0.0-py3-none-any.whl:
Publisher:
build.yml on Quantco/sqlcompyre
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqlcompyre-2.0.0-py3-none-any.whl -
Subject digest:
1de861985aaf49b94856a519becb7fe75d87159486ec699d47b869efb7846d0b - Sigstore transparency entry: 163061441
- Sigstore integration time:
-
Permalink:
Quantco/sqlcompyre@4e8479479a010e8fdd5f4a12ce6c0278459e7045 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/Quantco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@4e8479479a010e8fdd5f4a12ce6c0278459e7045 -
Trigger Event:
release
-
Statement type: