Skip to main content

Trusted Twin Python client

Project description

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:

pip install trustedtwin

To use asynchronous client:

pip install trustedtwin[async]

By default, additional packages required by asynchronous version are not installed.

Usage

Authorization

For synchronous client:

from trustedtwin.tt_api import TTRESTService

TT_SERVICE = TTRESTService(auth=$USER_SECRET)

For asynchronous client:

from trustedtwin.tt_api_async import TTAsyncRESTService

TT_SERVICE = TTAsyncRESTService(auth=$USER_SECRET)

Example calls

For synchronous client:

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:

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.

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.

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

trustedtwin-3.13.20240320133508.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

trustedtwin-3.13.20240320133508-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file trustedtwin-3.13.20240320133508.tar.gz.

File metadata

File hashes

Hashes for trustedtwin-3.13.20240320133508.tar.gz
Algorithm Hash digest
SHA256 1abb6e75e107606c2f6eecf89d06f6fdfb75c6560993d122d14bd377e4183d0b
MD5 c549e0d69750362b8853de695e88d32e
BLAKE2b-256 f85a5e3cb94cb0a4c6720c9c2022faead7074c6f2cee66a0b18e28a5c3ed103d

See more details on using hashes here.

File details

Details for the file trustedtwin-3.13.20240320133508-py3-none-any.whl.

File metadata

File hashes

Hashes for trustedtwin-3.13.20240320133508-py3-none-any.whl
Algorithm Hash digest
SHA256 60a0859e8b3d4b0cd13e850b2fae2fa2524f0245d48fbcb6ba375de489ae043a
MD5 ae36e8d7e13f8f09da251b1b32b2b467
BLAKE2b-256 7c46582de51ae84348639d744e03a4fbb405db83da6ea260e8c2e74cedff6d2b

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