Skip to main content

No project description provided

Project description

Touchpoint Client

PyPI - Version PyPI - Python Version


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


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.7.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

touchpoint_client-0.3.7-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file touchpoint_client-0.3.7.tar.gz.

File metadata

  • Download URL: touchpoint_client-0.3.7.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for touchpoint_client-0.3.7.tar.gz
Algorithm Hash digest
SHA256 9eedb2c158d5841267f750df5ab7e02566612c7020c6fe03aaa92fb0806e25f8
MD5 20eaeb17b5ff7b21a3c9e4e2da7b66f0
BLAKE2b-256 f7809bff8cb31a50c9e39677b21516e5836e08c4ab4f49c4964560692fb82d0e

See more details on using hashes here.

File details

Details for the file touchpoint_client-0.3.7-py3-none-any.whl.

File metadata

File hashes

Hashes for touchpoint_client-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b0357096827773600cbad02600b95eecf48de415431cfe560efc05d935b7d6f0
MD5 390611c048806edc9b321820f3f18121
BLAKE2b-256 9be1c5e12be511e19caaa7e0706b58d5d3b6a5734b1237759c4ca8e867950f18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page