Module tripleblind.config

The Config object connects the SDK to the TripleBlind Router. It also provides access to the standard and custom variables and properties which reflect the current environment.

This is initialized from a tripleblind.yaml file, which looks something like this:

endpoint: ""
data_for_examples: "/my/example/data_dir"
sdkuser_token: ""  # obtained from the Router
mykey: "my value"  # user defined value

Default values will be used for the first two items, but the sdkuser_token must be defined in the YAML file.

Custom values can be defined within that YAML file as show above with mykey. This would be accessed in Python like this:

import tripleblind as tb

The YAML file is discovered by searching in the following order (first found wins):

1. Path specified in environment variable TB_API_CONFIG
2. "tripleblind.yaml" found in top-level script folder or a parent folder

Global variables


Explicitly show information about the config file loading via a '–verbose' command line parameter


class Config

Configuration settings and runtime environment information.

Instance variables

var active_team : int

int: ID of the active team or "" if using default

var ap_token : str

str: Token for the Access Point when operating in Enterprise Mode

var ap_url : str

str: URL for the Access Point when operating in Enterprise Mode

var config_file : pathlib.Path

str: Path of the tripleblind.yaml config file

var data_dir : pathlib.Path

str: Path to the standard data directory

var endpoint

str: URL for the API endpoint of the targeted Router

var gui_url

str: URL for the user interface of the targeted Router

var script_dir : pathlib.Path

str: Path of the top-level script


def get_config_var(self, key: str) -> str

Read a variable out of the configuration YAML


key : str
Key name of the value


Invalid configuration file found


Value from the config file, or None if not found
def resolve_path_rel_to_config(self, path)

Expand paths relative to the YAML file it was loaded from


path : str
A path, can be relative or absolute


An absolute path
def resolve_relative_path_var(self, key: str) -> str

Read a config variable and resolve relative paths


key : str
a key name in the config YAML


The loaded key value converted to an absolute path, or None if not found
def using_enterprise_mode(self) -> bool

Determine if in Enterprise Mode where API calls run through the Access Point

Enterprise Mode is enabled when the access_point_url and access_point_token values are set in the tripleblind.yaml.


True if operating in Enterprise Mode