Python library to download data from Salesforce and synchronize with a relational database
Project description
salesforce-dbsync
Python library to download data from Salesforce and synchronize with a relational database
Example
This example performs the following steps for Salesforce Object 'Account' when run for the first time:
- Download Table Metadata from Salesforce
- Downloads Table Data from Salesforce
- Creates a MySQL Database if it does not already exists
- Creates Tables in MySQL alongwith Indexes if the Table does not already exist
- Uploads the data into the MySQL Tables
In the subsequent runs, it will perform the following steps:
- Downloads Table Data from Salesforce
- Refreshes data in MySQL with any new records or updates that were detected in Salesforce. Note: Deletes in Salesforce are ignored
from salesforce-dbsync import Screenwriter
import sys
from screenwriter import Screenwriter
from salesforce_dbsync import Sync_Manager
def do_init ():
global sw, sync_mgr
sw = Screenwriter ()
db_creds = {'user':'mysql_uid', 'passwd':'mysql_pwd', 'db':'TESTDB'}
sf_creds = {'user':'sf_uid', 'passwd':'pb_pwd', 'token':'sf_tok'}
control_map = {'min-SystemModstamp-date':'2019-01-01', 'dml-limit':10000}
sync_mgr = Sync_Manager (sw, db_creds, sf_creds, control_map)
def do_main ():
global sw, sync_mgr
sync_mgr.add_sync_profile ('Account', ['Name','BillingStreet'], [])
sync_mgr.init_mysql ()
sync_mgr.init_sfdc ()
sync_mgr.create_missing_db_tables ()
sync_mgr.sync ()
do_init ()
do_main ()
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
File details
Details for the file salesforce-dbsync-1.3.1.tar.gz
.
File metadata
- Download URL: salesforce-dbsync-1.3.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08892732b91e3b9a66c17ca67322975aa37aa6e56216bbfa4d5485004d34e736 |
|
MD5 | 3663552c7ebc1232b19a4fb6dd18700f |
|
BLAKE2b-256 | 8d4e36f5bb8c99387149021dda6050f9aba0ac8f3d2a2a0acd5c65a9d9d0ea6b |
File details
Details for the file salesforce_dbsync-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: salesforce_dbsync-1.3.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33c7a6b6edc8d6cfd732a9aa513398daeab3f75102da112b82d422673fa1d729 |
|
MD5 | 84bb63fcb6bd0a0910d295ec46d9c49f |
|
BLAKE2b-256 | 61864f0e6e225ee1b4042e812e3f815a9bb3c1a2c2693e0b6b92e184b5e488f0 |