Skip to main content

Python SDK for Aparavi Data Toolchain API

Project description

Aparavi Data Toolchain SDK

A Python SDK for interacting with the Aparavi Web Services API. This SDK provides a clean, type-safe interface for validating pipelines, executing tasks, monitoring status, and managing webhooks with the Aparavi platform.


Description

This SDK simplifies integration with Aparavi's data processing pipelines by providing:

  • validate_pipeline: Validates a pipeline structure against Aparavi's backend to ensure it is correctly formed.
  • execute_pipeline: Submits a pipeline for execution on the Aparavi platform.
  • get_pipeline_status: Fetches the current execution status of a pipeline task.
  • teardown_pipeline: Gracefully ends a running pipeline task.
  • send_payload_to_webhook: Sends file(s) to a running webhook-based pipeline.
  • execute_pipeline_workflow: Performs a full end-to-end execution lifecycle for a pipeline.
  • get_version: Fetches the current version of the Aparavi API/backend.

Perfect for data engineers, analysts, and developers building automated data processing workflows.


Setup

  1. Get your credentials:
  • Obtain your API key from the Aparavi console
  • Note your API base URL (e.g. https://eaas.aparavi.com/)
  1. Install package:

    pip install aparavi-dtc-sdk
    
  2. Create .env file:

    Linux/macOS:

    touch .env
    

    Windows:

    type nul > .env
    

Env file

APARAVI_API_KEY=aparavi-dtc-api-key
APARAVI_BASE_URL=https://eaas.aparavi.com/

Quick Start

The Aparavi SDK supports a simplified, one-step method for executing pipelines. This method performs validation, execution, monitoring, and teardown in a single call:

import os

from dotenv import load_dotenv
from aparavi_dtc_sdk import AparaviClient

load_dotenv()

client = AparaviClient(
    base_url=os.getenv("APARAVI_BASE_URL"),
    api_key=os.getenv("APARAVI_API_KEY")
)

result = client.execute_pipeline_workflow(
    pipeline="./pipeline_config.json",
    file_glob="./*.png"
)

print(result)

NOTE: While we continue to evolve the SDK to support more flexible and modular pipeline workflows, the single-function call approach (execute_pipeline_workflow) will remain fully supported for the foreseeable future. This ensures backward compatibility and allows existing integrations to continue working without any changes.

Pre Built Pipelines

Available pre-built pipeline configurations:

  • AUDIO_AND_SUMMARY: Processes audio content and produces both a transcription and a concise summary.
  • SIMPLE_AUDIO_TRANSCRIBE: Processes audio files and returns transcriptions of spoken content.
  • SIMPLE_PARSER: Extracts and processes metadata and content from uploaded documents.
import os

from dotenv import load_dotenv
from aparavi_dtc_sdk import AparaviClient, PredefinedPipelines # Import PredefinedPipelines enum

load_dotenv()

client = AparaviClient(
    base_url=os.getenv("APARAVI_BASE_URL"),
    api_key=os.getenv("APARAVI_API_KEY")
)

result = client.execute_pipeline_workflow(
    pipeline=PredefinedPipelines.SIMPLE_AUDIO_TRANSCRIBE, # Specify PredefinedPipelines
    file_glob="./audio/*.mp3"
)

print(result)

Power user quick start

import json
import os

from dotenv import load_dotenv
from aparavi_dtc_sdk import AparaviClient

load_dotenv()

client = AparaviClient(
    base_url=os.getenv("APARAVI_BASE_URL"),
    api_key=os.getenv("APARAVI_API_KEY")
)

try:
    validation_result = client.validate_pipeline("pipeline_config.json")
except Exception as e:
    print(f"Validation failed: {e}")

try:
    start_result = client.execute_pipeline(pipeline_config, name="my-task")
    if start_result.status == "OK":
        token = start_result.data["token"]
        task_type = start_result.data["type"]

        status_result = client.get_pipeline_status(token=token, task_type=task_type)

        end_result = client.teardown_pipeline(token=token, task_type=task_type)

except Exception as e:
    print(f"Task operation failed: {e}")

NOTE: We will soon sunset the multi-step pipeline execution process in favor of a simplified, single-method call that improves usability and reduces boilerplate code. The above pattern—using separate calls to validate_pipeline, execute_pipeline, get_pipeline_status, and teardown_pipeline—will no longer be supported in future SDK versions.


Development

Setting up for development

# Install in development mode
pip install -e ".[dev]"

# Find package Install
pip list | grep aparavi

# Show package info
pip show aparavi-dtc-sdk

# Run linting
flake8 aparavi-dtc-sdk/
black aparavi-dtc-sdk/
mypy aparavi-dtc-sdk/

Running Tests

pytest tests/

Support

For problems and questions, please open an issue on the GitHub repository.


Authors

Joshua D. Phillips
github.com/joshuadarron

Contributions welcome — feel free to submit a PR or open an issue!

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

aparavi_dtc_sdk-1.1.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

aparavi_dtc_sdk-1.1.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file aparavi_dtc_sdk-1.1.1.tar.gz.

File metadata

  • Download URL: aparavi_dtc_sdk-1.1.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for aparavi_dtc_sdk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 daeb1f38d324c7f17387b454f4a2b218e661bb234e5a56db010d19c8bed51d46
MD5 14392561ad96970d27b5759f3938ec80
BLAKE2b-256 d380bee9deb8d6cac47231dec38347ee3245d32c642f2384f386ac69f6ceaf14

See more details on using hashes here.

File details

Details for the file aparavi_dtc_sdk-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aparavi_dtc_sdk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 714234d8f2ea0132a52506b5d897c8b3ca5fb89b1aa4fc6c9fe3c411e2cfed80
MD5 935d9312ba66a50e57185886316907b9
BLAKE2b-256 43085dcf81f208266c809a4547ae3250c2edae425d02992e579932b2442a9c59

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