tensorone logo

SDKs

Overview

Get started with setting up your Tensor One projects using Python. Depending on the specific needs of your project, there are various ways to interact with the Tensor One platform. This guide provides an approach to get you up and running.


Install the Tensor One SDK

Create a Python virtual environment to install the Tensor One SDK library. Virtual environments allow you to manage dependencies for different projects separately, avoiding conflicts between project requirements.

To get started, install setup a virtual environment then install the Tensor One SDK library.

Create a Python virtual environment with venv

Linux & MacOS

python3 -m venv env
source env/bin/activate

Windows

python -m venv env
env\Scripts\activate

To install the SDK, run the following command from the terminal.

python -m pip install tensorone

You should have the Tensor One SDK installed and ready to use.

Get Tensor One SDK version

To ensure you've setup your Tensor One SDK in Python, choose from one of the following methods to print the Tensor One Python SDK version to your terminal.

Run the following command using pip to get the Tensor One SDK version.

pip show tensorone

You should see something similar to the following output.

tensorone==1.6.1

Now that you've installed the Tensor One SDK, add your API key.

Add your API key

Set api_key and reference its variable in your Python application. This authenticates your requests to the Tensor One platform and allows you to access the Tensor One API

import tensorone
import os

tensorone.api_key = os.getenv("TENSORONE_API_KEY")

Note

It's recommended to use environment variables to set your API key. You shouldn't load your API key directly into your code.

For these examples, the API key loads from an environment variable called TENSORONE_API_KEY.

Now that you've have the Tensor One Python SDK installed and configured, you can start using the Tensor One platform.

Previous
Javascript Endpoints