Skip to content

Getting started

Installation

pip install --upgrade earnix-elevate
pdm add earnix-elevate
poetry add earnix-elevate

Authentication

To authenticate to Earnix Elevate from code, it needs to have access to valid API credentials:

  1. In the Elevate UI, click your user icon in the top right-hand corner and select Profile.

  2. Under My Account, click on Personal Tokens and then Generate Token.

  3. Enter a description for the token, an expiration timeframe, and click Create. This activates your new key, making it ready for use.

  4. Record the Client ID and Secret Key, so you can later reference them for authentication.

    Warning

    Once you click on Done, you won’t be able to access this information again.

  5. Generated tokens can be listed and deleted in the same Personal Tokens table.

Use the credentials

We provide two ways to let the SDK authenticate:

  • Using Service constructor arguments like in the example below. We don't recommend hard-coding credentials in your code. If you use this method, please store the values in a secure location and read from it beforehand.

  • Using environment variables. These can be as secure as your setup makes them be. The possibilities include using export in some shells, using %env in notebooks, injecting from a container/service orchestrator and many more. The variable keys are:

    Key Description
    E2_SERVER The server your Elevate account is registered in.
    E2_CLIENT_ID Your Client ID.
    E2_SECRET_KEY Your Secret Key.

Example usage

print_connections.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
from earnix_elevate import ConnectionService

connection_service = ConnectionService(
    server="eu",
    client_id="...",
    secret_key="...",  # Do not hard-code credentials!
)

my_connections = connection_service.list_connections().items

print(my_connections)