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.0.tar.gz (14.6 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.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aparavi_dtc_sdk-1.1.0.tar.gz
  • Upload date:
  • Size: 14.6 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.0.tar.gz
Algorithm Hash digest
SHA256 3625e49cb448d2b400d6be4c5071e6b8260d38d5f7de76376184bd001610cb9d
MD5 0c8cffadd119524da86b31a1e2ca9473
BLAKE2b-256 3f9ea3fa440842b575965f91e608c163c897e8a5dc82410def0ee45012757deb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aparavi_dtc_sdk-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afed9ff146f063dba7cb959f59e5fd66e277eef7b20e243b511fe23922af5381
MD5 c75aa6019932eaa7ff63a5db04f66622
BLAKE2b-256 7b53baf2b9f586a0a15fb5992276e265e105d782330566dcb9ecbacd7a7824d1

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