Skip to main content
Skip table of contents

The SDK from Spaces

The Harbr SDK refers to the Python package that provides streamlined interaction with the Platform API and Session Management. In addition to session management and platform actions (interactions with individual API endpoints), the SDK contains a suite of workflow methods that enable the programmatic execution of end-to-end user journeys with simple / streamlined parameterisation.    

The Harbr Platform SDK allows users to perform platform actions programmatically - ideal for automating workflows or managing outputs from Spaces.

The Harbr Platform SDK is in continual development, with additional methods added based on customer and Harbr roadmap requirements. 

Latest Version : 1.5.0 (August 2025)

harbr_platform_latest.zip

Installation

Your account management team will provide you with the Harbr Platform SDK package as a Zip file. The Zip file will have the naming convention harbr_platform_latest.zip

To install the package into your environment, follow the steps below: 

  • Copy the Zip file into a directory of your choosing. If the directory is not within your PYTHONPATH, update your PYTHONPATH to include this additional location

  • Unzip the package using a your chosen utility (e.g. unzip). You will now see a directory called harbr_platform.

  • Install the requirements.txt file within this directory using the command pip install -r requirements.txt

  • The SDK has only a small number of dependencies and so is usually able to be installed within existing Python environments, but virtual environments can be used if preferred.

Once these actions are complete validate the installation by activate a python session an importing the library as : 

from harbr_platform import *

All Spaces python environment are pre-configured with the latest version of the Harbr Platform SDK and are pre-populated with platform API session configuration for your user.

This allows the simple creation of an SDK session using the code below when using the SDK from a Space.

PY
import harbr_platform
from harbr_platform import session, workflow, platform_actions

session_details = session.create_session(session_source = "space") 

Using the SDK from a Space is particularly beneficial when creating Assets, Code Assets and Tasks from the environment that you’re currently working in, allowing you remain in context and efficiently create shareable Assets out of your analysis, investigations and engineering.

Many of the SDK methods to create objects from Spaces require the Space ID as a parameter input. This can be obtained with the simple code below (universal for all Spaces).

PY
import json

session_metadata_config_file = '/tmp/space_details.json'

with open(session_metadata_config_file, 'r') as session_metadata_file:
        session_metadata_config = json.load(session_metadata_file)

space_id = session_metadata_config.get("space_id") 

Example Notebook

Attached below is an example Jupyter notebook that guides through the process of creating one-time Data Assets, Code Assets and Tasks from within a Space. If you wish to explore this feature, please download this notebook and upload into your Space via the JupyterLab file browser.

This upload action assumes the use of Spaces Workbench (VDI-Less) , if you require access to this notebook within Spaces Sandbox (VDI) please contact your account manager.

HarbrPlatform_SDK_Example.ipynb

HarbrPlatform_SDK_Example.ipynb

If you wish to explore the Create Code Assets and Tasks section of this example before you have your own Queries or Notebooks ready for automation, please also upload the hello_world.ipynb notebook attached below in the home area of your Space via JupyterLab.

hello_world.ipynb

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.