Skip to main content

A tool for moving data between relational databases.

Project description

simple-transfer

Easy data transfers between relational databases. Specify the source/destination connection, schema, and table and simple-transfer does the rest.

Quickstart

import logging

from simple_transfer import MySQLConnection, Pipeline, PostgreSQLConnection

logging.basicConfig(level=logging.INFO)


source_connection = PostgreSQLConnection(
    host="source-database.xxx.us-east-1.rds.amazonaws.com",
    port=5432,
    username="<username>",
    password="<password>",
    db="postgres",
)

destination_connection = MySQLConnection(
    host="destination-database.xxx.us-east-1.rds.amazonaws.com",
    port=3306,
    username="<username>",
    password="<password>",
    db="my_db",
)

pipeline = Pipeline(
    source_connection=source_connection,
    source_schema="public",
    source_table="source_table",
    destination_connection=destination_connection,
    destination_schema="my_db",
    destination_table="destination_table",
    inject_mode="swap",
)
pipeline.execute()

Supported Databases

  • PostgreSQL
  • MySQL

Supported temporary storage locations

This package utilizes the smart_open package when opening a file object, this enables the intermediate storage location to be anything supported by this library:

  • Local File System
  • AWS S3
  • Azure Blob Storage
  • GCP Cloud Storage

Injection Methods

overwrite

This mode will drop and recreate the table if it exists before inserting the data into it.

append

This mode will create the table if it doesn't exist, and then insert the data into it.

swap

This mode will create a swap table and insert the data into it. Then in a transaction it will swap the names of the swap table and existing table and then drop the now renamed existing table.

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

simple-transfer-0.1.1.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

simple_transfer-0.1.1-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file simple-transfer-0.1.1.tar.gz.

File metadata

  • Download URL: simple-transfer-0.1.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for simple-transfer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9663c17f850fbbac8cf372904e7902778ab6a516e69543231d549752e373fbae
MD5 da7229ce248c44464c1c32045a1eeca6
BLAKE2b-256 36b1d626a6ba8efa43524ffccf7f4dd76796f08a92270deafbf9de699fe4d8ae

See more details on using hashes here.

File details

Details for the file simple_transfer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_transfer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4463b163d20ea9eb5543a2100915857935f2c885a1fd102df2d47cd7c1619664
MD5 b7c74c015c79b282e3b0b75c555eeb38
BLAKE2b-256 c8a61820d62b6785630fd3e4172c6ca3b6c4443a8bb298eecb876f59634df480

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page