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="agents_table_name",
    agent_event = "agent_event_table_name"
    agent_pause="agent_pause_table_name",
    agent_summary="agent_summary_table_name",
    
    calls="call_table_name",
    call_rating="call_rating_table_name",
    
    chat="chat_table_name",
    chat_message="chat_message_table_name",
    
    profilers="profiler_table_name",
    trees="trees_table_name",
    
    queue="queue_table_name",
    queue_summary= "queue_summary_table_name",
    
    fromPeriod=1678449585,
    
    agent_event_id=74450,
    
    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= "agents_table_name", 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_table_name", echo = True ).syncronize()

agent_event_id

The agent_event_id parameter must be declared in number format. It is a filter for the agent event history.

  • the syncronizer will look for the most recent agent_event_id (max value) in the mirrored database and mirror from this id on.

  • If no data is found in mirrored database, the syncronizer will use the agent_event_id parameter declared in the Syncronizer

  • If no agent_event_id parameter was declared to the Syncronizer, it will set the filter to 0 and syncronize the information from the smallest agent_event_id found in the vonix database

Syncronizer(token, database, agent_event = "agent_event_history_table_name" ,agent_event_id = 74636)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.9.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

vonixsync-1.0.9-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vonixsync-1.0.9.tar.gz
  • Upload date:
  • Size: 18.2 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.9.tar.gz
Algorithm Hash digest
SHA256 6526887a6db6cf1b193281bbd17228d441f54e78099d142ca11086de2914e832
MD5 e5653a0eb4ac6ae175efc2a39f78031e
BLAKE2b-256 f6c1560fe02546b0bba36faf1208c1386a4f0584c125708c82254097b376f795

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vonixsync-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 34.2 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f84b447460a7b7c60aec574df8e7bb2686eea4316bca08a67cc9a21ec7829b87
MD5 9502443cfc8d26a187a72bf97b789a2b
BLAKE2b-256 f7eb954bf69a5dfe1d8877439ea40128f7eac42eb90d63e87f426176f4f8a4e7

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