Name | vonixsync JSON |
Version |
1.0.11
JSON |
| download |
home_page | |
Summary | Database syncronizer |
upload_time | 2023-03-27 12:38:24 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.9 |
license | |
keywords |
syncronizer
vonix
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# vonixsync
vonixsync is a python library for syncronization/database mirroring of the vonix database
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install vonixsync.
```bash
pip install vonixsync
```
## Usage
```python
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.
```python
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.
```python
Syncronizer(token, database, queue = "queue", echo = True ).syncronize()
```
Raw data
{
"_id": null,
"home_page": "",
"name": "vonixsync",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Luiz <luiz@vonix.com.br>, Vonix <contato@vonix.com.br>",
"keywords": "syncronizer,vonix",
"author": "",
"author_email": "Victor Leone <victor@vonix.com>",
"download_url": "https://files.pythonhosted.org/packages/8f/eb/168b3401c5cef3d130875fdaa1573ed624bd88bf7be371eb0c73b28def32/vonixsync-1.0.11.tar.gz",
"platform": null,
"description": "# vonixsync\n\nvonixsync is a python library for syncronization/database mirroring of the vonix database\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install vonixsync.\n\n```bash\npip install vonixsync\n```\n\n## Usage\n\n```python\nimport vonixsync\nfrom vonixsync import DBConfigs\nfrom vonixsync import Syncronizer\n\n#Import the DBConfigs class. Provide the parameters used to construct the string used to connect to the database, according to its singular dialect.\nconnection_configs = DBConfigs(\n database_manager=\"postgres\",\n user=\"postgres\",\n password=\"postgres\",\n hostname=\"localhost\",\n database=\"postgres\",\n port=5432,\n)\n\nconnection = connection_configs.connect\n\n# Declare your token as a string type\ntoken = \"token_provided_by_vonix_support\"\n\n#Import the Syncronizer Class to effectively syncronize the data to your database and name all tables \nSyncronizer(\n \n token=token,\n \n connection=connection,\n\n agents=\"agent\",\n agent_event = \"agent_event\",\n agent_pause=\"agent_pause\",\n agent_summary=\"agent_summary\",\n \n calls=\"call\",\n call_ratings=\"call_rating\",\n \n chats=\"chat\",\n chat_message=\"chat_message\",\n \n profilers=\"profiler\",\n trees=\"trees\",\n \n queues=\"queue\",\n queue_summary= \"queue_summary\",\n \n fromPeriod=1678449585,\n \n echo=True\n\n).syncronize()\n\n```\nNow run the code.\n#\n## Syncronizer Options\n\nBesides the obligatory token, database_string parameters and names of the tables to be syncronized, the Syncronizer has other options:\n#\n### fromPeriod\n#\nThe timestamp parameter must be declared in timestamp format. It is an obligatory filter for the summary tables.\n\n- the syncronizer will look for the most recent inserted row in the mirrored database and mirror from this row's date on. \n\n- If no data is found in the mirrored database the syncronizer will mirror data using the fromPeriod timestamp value provided to the Syncronizer.\n\n- If no timestamp parameter was provided, the Syncronizer will use the timestamp from the day before the current date.\n\n```python\nSyncronizer(token, database, agent= \"agent\", fromPeriod = 1679067723 ).syncronize()\n```\n#\n### echo\n#\nThe 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.\nThis a feature provided by the SQLAlchemy library. It can be set with or without other optional parameters.\n\n```python\nSyncronizer(token, database, queue = \"queue\", echo = True ).syncronize()\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Database syncronizer",
"version": "1.0.11",
"split_keywords": [
"syncronizer",
"vonix"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "87d72f262e9878d804ab5ecc977703740e33d2907cc2d81ca2ea3e4016f382ff",
"md5": "af9fb10145117ac3907821b5f5e2e1fa",
"sha256": "946559428c15bde60abfb2c8a31d59422026441599ba4840fdd77aff83a97831"
},
"downloads": -1,
"filename": "vonixsync-1.0.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "af9fb10145117ac3907821b5f5e2e1fa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 34031,
"upload_time": "2023-03-27T12:38:22",
"upload_time_iso_8601": "2023-03-27T12:38:22.255158Z",
"url": "https://files.pythonhosted.org/packages/87/d7/2f262e9878d804ab5ecc977703740e33d2907cc2d81ca2ea3e4016f382ff/vonixsync-1.0.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8feb168b3401c5cef3d130875fdaa1573ed624bd88bf7be371eb0c73b28def32",
"md5": "f2cf2024cab136638332bd311f290c2c",
"sha256": "bd14dd0f1776f19277d38e361d812f22e3a65a4350d3f2699dced53fa79e0094"
},
"downloads": -1,
"filename": "vonixsync-1.0.11.tar.gz",
"has_sig": false,
"md5_digest": "f2cf2024cab136638332bd311f290c2c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 17893,
"upload_time": "2023-03-27T12:38:24",
"upload_time_iso_8601": "2023-03-27T12:38:24.153985Z",
"url": "https://files.pythonhosted.org/packages/8f/eb/168b3401c5cef3d130875fdaa1573ed624bd88bf7be371eb0c73b28def32/vonixsync-1.0.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-27 12:38:24",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "vonixsync"
}