Skip to main content

Authentication

After installing the TIM Python client, the Python client can be used inside any Python project.

Importing the TIM client

To start using the Python client, the user first needs to import it. Importing the Tim class can be done via the following Python import statement:

import tim

Initialization

tim.Tim(email: str, password: str, server: str = 'https://tim-platform.tangent.works/api/v5')

After having accessed the Tim class, it can be used to authenticate with valid credentials. This will create an instance of the class that can be used to utilize all other functionalities of the TIM Python client. Initializing can be done with the following statement:

client = tim.Tim(email = "<user email>", password = "<user password>")

using keyword arguments, or with the following statement:

client = tim.Tim("<user email>", "<user password>")

using positional arguments, where <user email> and <user password> are replaced by the user's email and password, respectively.

A third optional argument server is available, and can be used to configure the base server requests should be routed to. This server should point to a valid REST API of the TIM engine with version v5 or higher. If not passed, all calls will be routed to the TIM SaaS offering. To set it, initializing should be done with the following statement:

client = tim.Tim(email = "<user email>", password = "<user password>", server = "<TIM REST API server>")

using keyword arguments, or with the following statement:

client = tim.Tim("<user email>", "<user password>", "<TIM REST API server>")

using positional arguments, where <user email>, <user password> and <TIM REST API server> are replaced by the user's email and password and, respectively.