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:
from tim import Tim
Initialization
Tim(email: str, password: str, endpoint: str = 'https://tim-platform.tangent.works/api/v5')
After having imported 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(email = "<user email>", password = "<user password>")
using keyword arguments, or with the following statement:
client = 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 endpoint
is available, and can be used to configure the base endpoint requests should be routed to. This endpoint 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(email = "<user email>", password = "<user password>", endpoint = "<TIM REST API endpoint>")
using keyword arguments, or with the following statement:
client = Tim("<user email>", "<user password>", "<TIM REST API endpoint>")
using positional arguments, where <user email>
, <user password>
and <TIM REST API endpoint>
are replaced by the user's email and password and, respectively.