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,
agents="agent",
agent_event = "agent_event",
agent_pause="agent_pause",
agent_summary="agent_summary",
calls="call",
call_ratings="call_rating",
chats="chat",
chat_message="chat_message",
profilers="profiler",
trees="trees",
queues="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, agents= "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, queues = "queue", echo = True ).syncronize()
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 vonixsync-1.0.12.tar.gz
.
File metadata
- Download URL: vonixsync-1.0.12.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40db275383fbde1c0cf833c2ed79b543aa01012c4d2e5cbbc5fc14d45849719b |
|
MD5 | a747db6816266bad1f3b1f630c4da805 |
|
BLAKE2b-256 | adad69faae24b4105f96c9e8783080132d58b9a7eaad204c72017d1f4476e68b |
File details
Details for the file vonixsync-1.0.12-py3-none-any.whl
.
File metadata
- Download URL: vonixsync-1.0.12-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c96cedf19ef2030d0863c3a931f64b3a1b773b6b1df0832628b85e7e1275ba4 |
|
MD5 | fd072e5f908bd8b7b6f8eef696fb76f5 |
|
BLAKE2b-256 | b8713eeb7d5bdb0685c06a296cc3b5447b3ce0486b6d3c3f891a612e40ab8d36 |