Links

Using kolena-client

Testing on Kolena is conducted using the kolena-client Python package. You use the client to create and run tests from your infrastructure that can be explored in our web platform.

Installation

The first step to start testing with Kolena is to install kolena-client. From the developer page (</>) on Kolena, generate an API token and set the KOLENA_TOKEN environment variable:
export KOLENA_TOKEN="********"
Client builds can be installed with any Python package manager such as pip and poetry:
pip
poetry
pip3 install --extra-index-url "https://$KOLENA_TOKEN@gateway.kolena.cloud/repositories" kolena-client
  1. 1.
    Configure the kolena repository in Poetry:
    poetry config repositories.kolena https://gateway.kolena.cloud/repositories
    poetry config http-basic.kolena "$KOLENA_TOKEN" ""
  2. 2.
    Add the kolena source to your project by adding this block to your pyproject.toml:
    [[tool.poetry.source]]
    name = "kolena"
    url = "https://gateway.kolena.cloud/repositories"
    secondary = true
  3. 3.
    Install:
    poetry add kolena-client
Seeing authentication issues (401 client error)?
Poetry overhauled its credential handling in 1.2 to fix various issues with private repositories. Consider updating your Poetry installation to the latest stable release.

Initialization

Before using the kolena-client to create or run tests, initialize a client session:
import os
import kolena
kolena.initialize(os.environ["KOLENA_TOKEN"], verbose=True)
By default, sessions have static scope and persist until the interpreter is exited.
Additional logging can be configured by specifying initialize(..., verbose=True). All logging events are emitted as Python standard library logging events from the "kolena" logger as well as to stdout/stderr directly.

Supported Python Versions

kolena-client is compatible with all active Python versions.
Python Version
Compatible Client Versions
3.10
All Versions
3.9
All Versions
3.8
All Versions
3.7
All Versions
3.6 (EOL: December 2021)
≥0.22, ≤0.46