Skip to main content

ETL helper for moving tabular data between MSSQL, PostgreSQL, MySQL, and local files

Project description

SyncDB

Python ETL helper for moving tabular data between MSSQL, PostgreSQL, MySQL, and local files (CSV, Parquet, Excel, Pickle), with automatic schema creation, schema evolution, and batch progress reporting.


What it does

  • Database → Database — copy tables across engines with automatic type mapping
  • Database → File — export query results to CSV, Parquet, Excel, or Pickle
  • File → Database — load files into tables, creating them if they don't exist
  • Schema management — auto-creates tables, adds new columns, optionally drops stale ones
  • Incremental sync — high-watermark tracking so only changed rows are copied each run
  • Seven transfer modesappend, insert_only, upsert, full_refresh, append_staging, snapshot, soft_delete

Installation

pip install Qubdi-SyncDB

Install only the extras you need:

pip install "Qubdi-SyncDB[mssql]"      # SQL Server
pip install "Qubdi-SyncDB[postgres]"   # PostgreSQL
pip install "Qubdi-SyncDB[mysql]"      # MySQL / MariaDB
pip install "Qubdi-SyncDB[files]"      # Parquet + Excel
pip install "Qubdi-SyncDB[all]"        # Everything

CSV and Pickle work with no extras — they use Python's standard library.


Quick example

from syncdb import DatabaseConfig, ProgressMode, SyncDB

src = DatabaseConfig(
    engine="mssql",
    connection_string=(
        "Driver={ODBC Driver 17 for SQL Server};"
        "Server=prod-sql.internal,1433;Database=operations;"
        "UID=etl_user;PWD=etl_pass;TrustServerCertificate=yes;"
    ),
)

dst = DatabaseConfig(
    engine="postgresql",
    host="analytics-db.internal",
    database="warehouse",
    user="loader",
    password="loader_pass",
)

sync = SyncDB(source=src, target=dst, batch_size=20_000)

sync.sync_tables({
    "orders": {
        "source": "dbo.orders",
        "destination": "public.orders",
        "mode": "append",
        "primary_key": ["order_id"],
        "incremental_column": "updated_at",   # only rows changed since last run
        "watermark_store": "watermarks.json",
    },
    "customers": {
        "source": "dbo.customers",
        "destination": "public.customers",
        "mode": "full_refresh",
    },
})
SyncDB summary (standard)
+------------------+--------------+--------------+---------+---------+------+
| table            | mode         | rows written | batches | created | time |
+------------------+--------------+--------------+---------+---------+------+
| public.orders    | append       | 1,842        | 1       | no      | 0.4s |
| public.customers | full_refresh | 8,200        | 2       | no      | 0.9s |
+------------------+--------------+--------------+---------+---------+------+
total: 10,042 rows in 3 batches across 2 tables in 1.3s

Documentation

Full documentation — configuration, all transfer modes, incremental sync, data quality checks, file operations, and API reference — is available at:

https://qubdi-syncdb.readthedocs.io


License

Apache 2.0

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

qubdi_syncdb-1.0.0.tar.gz (43.1 kB view details)

Uploaded Source

Built Distribution

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

qubdi_syncdb-1.0.0-py3-none-any.whl (54.1 kB view details)

Uploaded Python 3

File details

Details for the file qubdi_syncdb-1.0.0.tar.gz.

File metadata

  • Download URL: qubdi_syncdb-1.0.0.tar.gz
  • Upload date:
  • Size: 43.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for qubdi_syncdb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 62544eb0d1dec2d8b033d203304ff0d5487c79198c0b9bd2d994e8bc75613218
MD5 53251ab6bbda44bd5a34d664b6905a5b
BLAKE2b-256 81c9e880eca407684d3bcb836a38679b0723738e06953ca40637d2f234b4ad0f

See more details on using hashes here.

File details

Details for the file qubdi_syncdb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: qubdi_syncdb-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 54.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for qubdi_syncdb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a71083b67fa7f459309460660fefb4553a0b7cbd8301ec69f797cc37afa80a93
MD5 5b67e7e1231df95b8696a6d79e98ae91
BLAKE2b-256 053687e939a519d0b47cf3029675291d80597a0f950e353443fbfa9e1fdf49b6

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