TrustedTwin Python Client (external info)
===
The Trusted Twin Python library makes it easy to use the Trusted Twin user infrastructure API in Python applications.
The library version is consistent with the Swagger version of the Trusted Twin API.
Client offers synchronous and asynchronous versions which can be used for communication with TT API.
Requirements
---
Library requires Python3.6+.
Installation
--
For synchronous API client:
```shell
pip install trustedtwin
```
To use asynchronous client:
```shell
pip install trustedtwin[async]
```
By default, additional packages required by `asynchronous` version are not installed.
Usage
---
### Authorization
For synchronous client:
```python
from trustedtwin.tt_api import TTRESTService
TT_SERVICE = TTRESTService(auth=$USER_SECRET)
```
For asynchronous client:
```python
from trustedtwin.tt_api_async import TTAsyncRESTService
TT_SERVICE = TTAsyncRESTService(auth=$USER_SECRET)
```
### Example calls
For synchronous client:
```python
import json
from trustedtwin.tt_api import TTRESTService
status, response = TTRESTService().create_user_secret($ACCOUNT_UUID, $PIN)
resp = json.loads(response)
TT_SERVICE = TTRESTService(tt_auth=resp['secret'])
_body = {
'description': {
'custom_name': 'custom_value'
}
}
status, response = TT_SERVICE.create_twin(body=_body)
resp = json.loads(response)
```
For asynchronous client:
```python
import json
from trustedtwin.tt_api_async import TTAsyncRESTService
status, response = await TTAsyncRESTService().create_user_secret($ACCOUNT_UUID, $PIN)
resp = json.loads(response)
TT_SERVICE = TTAsyncRESTService(tt_auth=resp['secret'])
_body = {
'description': {
'custom_name': 'custom_value'
}
}
status, response = await TT_SERVICE.create_twin(body=_body)
resp = json.loads(response)
```
For more information please navigate to the official [documentation](https://trustedtwin.com/docs/libraries/library-python.html).
TrustedTwin Python Client (internal info)
===
Updating the library
---
To update the Python library to the newest version:
1. Upload a tt_api.yaml file corresponding with the respective API version.
2. In the Gitlab interface in the left-hand side pane, select *Build* and go to the *Pipeline schedules* section.
3. By the *Deploy to official pyPi repository* schedule, click on the *Run pipeline schedule* button.
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/trustedtwin/solutions/trustedtwin-python-client",
"name": "trustedtwin",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "TrustedTwin",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/74/6c/c00193067d6d57a1b310407982060629a001746bf43dca9995e0fa9dc571/trustedtwin-3.14.20240415210628.tar.gz",
"platform": null,
"description": "TrustedTwin Python Client (external info)\n===\n\nThe Trusted Twin Python library makes it easy to use the Trusted Twin user infrastructure API in Python applications. \nThe library version is consistent with the Swagger version of the Trusted Twin API.\n\nClient offers synchronous and asynchronous versions which can be used for communication with TT API.\n\nRequirements\n---\nLibrary requires Python3.6+.\n\nInstallation\n--\n\nFor synchronous API client:\n```shell\npip install trustedtwin\n```\n\nTo use asynchronous client:\n```shell\npip install trustedtwin[async]\n```\n\nBy default, additional packages required by `asynchronous` version are not installed. \n\nUsage\n---\n\n### Authorization\n\nFor synchronous client:\n```python\nfrom trustedtwin.tt_api import TTRESTService\n\nTT_SERVICE = TTRESTService(auth=$USER_SECRET)\n```\n\nFor asynchronous client:\n```python\nfrom trustedtwin.tt_api_async import TTAsyncRESTService\n\nTT_SERVICE = TTAsyncRESTService(auth=$USER_SECRET)\n```\n\n### Example calls\n\nFor synchronous client:\n```python\nimport json \nfrom trustedtwin.tt_api import TTRESTService\n\nstatus, response = TTRESTService().create_user_secret($ACCOUNT_UUID, $PIN)\nresp = json.loads(response)\n\nTT_SERVICE = TTRESTService(tt_auth=resp['secret'])\n\n_body = {\n 'description': {\n 'custom_name': 'custom_value'\n }\n}\n\nstatus, response = TT_SERVICE.create_twin(body=_body)\nresp = json.loads(response)\n```\n\nFor asynchronous client:\n```python\nimport json \nfrom trustedtwin.tt_api_async import TTAsyncRESTService\n\nstatus, response = await TTAsyncRESTService().create_user_secret($ACCOUNT_UUID, $PIN)\nresp = json.loads(response)\n\nTT_SERVICE = TTAsyncRESTService(tt_auth=resp['secret'])\n\n_body = {\n 'description': {\n 'custom_name': 'custom_value'\n }\n}\n\nstatus, response = await TT_SERVICE.create_twin(body=_body)\nresp = json.loads(response)\n```\n\nFor more information please navigate to the official [documentation](https://trustedtwin.com/docs/libraries/library-python.html).\n\nTrustedTwin Python Client (internal info)\n===\n\nUpdating the library\n---\n\nTo update the Python library to the newest version:\n\n1. Upload a tt_api.yaml file corresponding with the respective API version.\n2. In the Gitlab interface in the left-hand side pane, select *Build* and go to the *Pipeline schedules* section.\n3. By the *Deploy to official pyPi repository* schedule, click on the *Run pipeline schedule* button.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Trusted Twin Python client",
"version": "3.14.20240415210628",
"project_urls": {
"Homepage": "https://gitlab.com/trustedtwin/solutions/trustedtwin-python-client"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8a5d489874fad9f86c058f0bda55997f44c72928666ecc44620edfb451b01178",
"md5": "c9e8ac7a796595231ea1abb0bed9f301",
"sha256": "1bd4937c855bd1b777338255b2325a3f6e3c9f26cea96c9ac495de1f4e9f20f0"
},
"downloads": -1,
"filename": "trustedtwin-3.14.20240415210628-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c9e8ac7a796595231ea1abb0bed9f301",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 24723,
"upload_time": "2024-04-15T21:06:47",
"upload_time_iso_8601": "2024-04-15T21:06:47.148080Z",
"url": "https://files.pythonhosted.org/packages/8a/5d/489874fad9f86c058f0bda55997f44c72928666ecc44620edfb451b01178/trustedtwin-3.14.20240415210628-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "746cc00193067d6d57a1b310407982060629a001746bf43dca9995e0fa9dc571",
"md5": "0eb876f64052618e0c097fdbc55c6bdf",
"sha256": "d218ec4fb4ab77758523331be7c12791fe86e2c7d80dd16eddc5c71f603b3c49"
},
"downloads": -1,
"filename": "trustedtwin-3.14.20240415210628.tar.gz",
"has_sig": false,
"md5_digest": "0eb876f64052618e0c097fdbc55c6bdf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 23438,
"upload_time": "2024-04-15T21:06:48",
"upload_time_iso_8601": "2024-04-15T21:06:48.335382Z",
"url": "https://files.pythonhosted.org/packages/74/6c/c00193067d6d57a1b310407982060629a001746bf43dca9995e0fa9dc571/trustedtwin-3.14.20240415210628.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-15 21:06:48",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "trustedtwin",
"gitlab_project": "solutions",
"lcname": "trustedtwin"
}