Skip to main content

Database syncronizer

Project description

vonixsync

vonixsync is a python library for syncronization/database mirroring of the vonix database

Installation

Use the package manager pip to install vonixsync.

pip install vonixsync

Usage

import vonixsync
from vonixsync import DBConfigs
from vonixsync import Syncronizer

#Import the DBConfigs class. Provide the parameters used to construct the string used to connect to the database, according to its singular dialect.
connection_configs = DBConfigs(
    database_manager="postgres",
    user="postgres",
    password="postgres",
    hostname="localhost",
    database="postgres",
    port=5432,
)

connection = connection_configs.connect

# Declare your token as a string type
token = "token_provided_by_vonix_support"

#Import the Syncronizer Class to effectively syncronize the data to your database and name all tables 
Syncronizer(
    
    token=token,
    
    connection=connection,

    agent="agent",
    agent_event = "agent_event",
    agent_pause="agent_pause",
    agent_summary="agent_summary",
    
    calls="call",
    call_rating="call_rating",
    
    chat="chat",
    chat_message="chat_message",
    
    profilers="profiler",
    trees="trees",
    
    queue="queue",
    queue_summary= "queue_summary",
    
    fromPeriod=1678449585,
    
    echo=True

).syncronize()

Now run the code.

Syncronizer Options

Besides the obligatory token, database_string parameters and names of the tables to be syncronized, the Syncronizer has other options:

fromPeriod

The timestamp parameter must be declared in timestamp format. It is an obligatory filter for the summary tables.

  • the syncronizer will look for the most recent inserted row in the mirrored database and mirror from this row's date on.

  • If no data is found in the mirrored database the syncronizer will mirror data using the fromPeriod timestamp value provided to the Syncronizer.

  • If no timestamp parameter was provided, the Syncronizer will use the timestamp from the day before the current date.

Syncronizer(token, database, agent= "agent", fromPeriod = 1679067723 ).syncronize()

echo

The echo parameter by default is False. But if declared as True, it will enable the logging of all SQL commands during the active phase of the syncronizer. This a feature provided by the SQLAlchemy library. It can be set with or without other optional parameters.

Syncronizer(token, database, queue = "queue", echo = True ).syncronize()

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

vonixsync-1.0.10.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

vonixsync-1.0.10-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file vonixsync-1.0.10.tar.gz.

File metadata

  • Download URL: vonixsync-1.0.10.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for vonixsync-1.0.10.tar.gz
Algorithm Hash digest
SHA256 7ec458756195572706389f06fe9a37b87169569e761cad35d080e0f77d468a95
MD5 f4871a41b1fc77749584920571465f8e
BLAKE2b-256 228e4a6658586736dca482ac843229e020549e82e5a4f670abb488076993e6b0

See more details on using hashes here.

File details

Details for the file vonixsync-1.0.10-py3-none-any.whl.

File metadata

  • Download URL: vonixsync-1.0.10-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for vonixsync-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 f3814e3736a06c6acdf0d0e75c38f1fb1183d4052493ad2bcc32e332f83f7b64
MD5 1f3c8cf9a567b079ea27187d09e2b20d
BLAKE2b-256 bd67c823394cc7f0886b226837374d5d9a251bfe1a6d7456e9e5e5f19bcd924c

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