Skip to main content

Digital.ai Release SDK

Project description

Digital.ai Release Python SDK

The Digital.ai Release Python SDK (digitalai-release-sdk) provides a set of tools for developers to create container-based integration with Digital.ai Release. It simplifies integration creation by offering built-in functions to interact with the execution environment.

Features

  • Define custom tasks using the BaseTask abstract class.
  • Subclass ApiBaseTask to access the Release APIs (releaseApi, phaseApi, taskApi, ...) through a ready-to-use client.
  • Easily manage input and output properties.
  • Interact with the Digital.ai Release environment seamlessly.

Installation

Install the SDK using pip:

pip install digitalai-release-sdk

Note: The SDK depends on digitalai-release-api-client, which is installed automatically.

Getting Started

Example Task: hello.py

The following example demonstrates how to create a simple task using the SDK:

from digitalai.release.integration import BaseTask

class Hello(BaseTask):
    
    def execute(self) -> None:
        # Get the name from the input
        name = self.input_properties.get('yourName')
        if not name:
            raise ValueError("The 'yourName' field cannot be empty")

        # Create greeting message
        greeting = f"Hello {name}"

        # Add greeting to the task's comment section in the UI
        self.add_comment(greeting)

        # Store greeting as an output property
        self.set_output_property('greeting', greeting)

Example Task using the Release API: ApiBaseTask

Subclass ApiBaseTask to call the Release v1 REST API without building a client yourself. Every API is exposed as a lazily created, cached property, all sharing a single client built from the task's "Run as user" context:

from digitalai.release.integration.api_base_task import ApiBaseTask


class ShowVersion(ApiBaseTask):

    def execute(self) -> None:
        release = self.releaseApi.getRelease(self.get_release_id())
        self.add_comment(f"Working on {release.title}")

🔗 Related Resources

Changelog

Version 26.3.0 (Beta)

🚀 Features

  • Added the ApiBaseTask base class, exposing every Release v1 API as a lazily created, cached property.
  • get_release_api_client() now supports optional credentials/server URL and requests library arguments.
  • Added get_phase_id() and get_folder_id() helper methods to BaseTask.

🛠️ Enhancements

  • Improved stability and error handling for API requests and Kubernetes tasks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

digitalai_release_sdk-26.3.0b7.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

digitalai_release_sdk-26.3.0b7-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file digitalai_release_sdk-26.3.0b7.tar.gz.

File metadata

File hashes

Hashes for digitalai_release_sdk-26.3.0b7.tar.gz
Algorithm Hash digest
SHA256 d8a13d8f6bbad39f0e4593898d619e6ddac6bac03ab79e236cd1ded6ba27928a
MD5 5367cbde46baa2dd0aac18779c261e9f
BLAKE2b-256 69b08b4c41f2af959cc4db37bf56361d4f4fe43aef1373e61e96aa280127f7e1

See more details on using hashes here.

File details

Details for the file digitalai_release_sdk-26.3.0b7-py3-none-any.whl.

File metadata

File hashes

Hashes for digitalai_release_sdk-26.3.0b7-py3-none-any.whl
Algorithm Hash digest
SHA256 87ef5365e55ca82ec55c58fe7917691bd8343a9c0700aafe8a645787486eba48
MD5 070555c8e34e660d510743cb98e45642
BLAKE2b-256 b92a57f300fb84e867bcb41a94a88ddf437d66582d0b1063163fcf3ec6ea3f51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page