No project description provided
Project description
Touchpoint Client
Table of Contents
Installation
pip install touchpoint-client
Usage
>>> from touchpoint_client import *
>>> credentials = dict(
... api_url = "https://api.v15.touchpoint-analytics.xyz/v1/",
... auth_url = "https://oauth.v15.touchpoint-analytics.xyz/token/",
... client_id = "1234567890",
... username = r"demo@username",
... password = r"demousernamepassword",
... }
>>> client = TouchpointClient(**credentials)
>>> client.profile.profile()
{'id': '973495689374985', 'account_id': '354878293746', 'username': 'demo@username'
, 'global_role': 'ACCOUNT_ADMIN', 'created_on': '2022-09-09T09:19:47.208Z', 'active': True
, 'is_confirmed': False, 'two_factor': False, 'modified_on': '2022-09-09T12:50:13.092Z'
, 'personal_settings': {'show_lag': True}, 'projects': [{'id': '702134155655258112', 'name': 'Видео'}
, {'id': '705981455884361728', 'name': 'Видео_РТК'}, {'id': '702134218578206720', 'name': 'Тест видео'}
, {'id': '695777230432772096', 'name': 'Аудио'}, {'id': '695778026528448512', 'name': 'Тест голосовой галереи'}
, {'id': '705981142221725696', 'name': 'video_rtc-cc'}], 'group_projects': []}
>>> projects = client.projects()
>>> fields = client.project('3089479827348976').get_fields()
>>>
Загрука в файловое хранилище и добавление файла в коллекцию
>>> data = b"some binary data or path to file"
>>> name = "file_name in staorage"
>>> metadata = {"record_start_time": "2023-12-04T13:00:20Z", "operator": "Operator 1"}
>>> tags = "test_call"
>>> file_info = client.storage.upload(data, name, metadata, tags)
>>> client.project('3089479827348976').append_file(file_info["id"], language="ru")
Поиск документов в проекте
>>> search_query = ProjectSearchBody(query=r'file.properties.operator:"Operator 1"', limit=10)
>>> search_query.dict()
{'query': 'file.properties.operator:"Operator 1"', 'filters': None, 'error': False, 'with_additional_account_filters': True
, 'fetch_fields': ['created_date', 'language', 'file.properties', 'categories'], 'highlight_info_fields': None
, 'with_title': True, 'with_snippet': False, 'with_url': True, 'with_image': False, 'with_rank': False
, 'highlight_title': False, 'highlight': None, 'sort': None, 'offset': 0, 'limit': 10, 'scroll': None}
>>> first_10_results = client.project('3089479827348976').search(search_query)
>>> all_results = list(client.project('3089479827348976').iterate_search(search_query))
License
touchpoint-client is distributed under the terms of the MIT license.
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
touchpoint_client-0.3.2.tar.gz
(25.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file touchpoint_client-0.3.2.tar.gz.
File metadata
- Download URL: touchpoint_client-0.3.2.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dba40d7560f994eacf5d2a4797518538dcda1dce21130fdcd5b0b65707ec9358
|
|
| MD5 |
7a6b82feebefb4f7db456680046233b4
|
|
| BLAKE2b-256 |
a6c2bdd463e45bf54a2f41a6cd25ea3f6c1b0daba778d5def772ca19a8c7eb7d
|
File details
Details for the file touchpoint_client-0.3.2-py3-none-any.whl.
File metadata
- Download URL: touchpoint_client-0.3.2-py3-none-any.whl
- Upload date:
- Size: 28.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fae9bff798b06d51646aef3a751e20aad95d2e9e1157ba5e9a9025e8781dcf9b
|
|
| MD5 |
d6fef646bdc809797a6340d5100a1bb2
|
|
| BLAKE2b-256 |
0c31a853dae78d57b58fcd4597d01e05c0fe5f740cef69b870c8d3b48015ff27
|