Skip to content

Examples Overview

The examples/ directory contains ready-to-run Python scripts that demonstrate the most common IVCAP Client SDK use cases.

Setup

All examples share a common setup in examples/_common.py:

from dotenv import load_dotenv
from ivcap_client.ivcap import IVCAP

# Load credentials from .dbg-env (or set environment variables directly)
load_dotenv('.dbg-env')
ivcap = IVCAP()

Create a .dbg-env file in the examples/ directory:

IVCAP_URL=https://api.your-ivcap-deployment.net
IVCAP_JWT=<your-jwt-token>

Then run any example from the examples/ directory:

cd examples/
python list_services.py

Available Examples

Service Discovery

Script What it demonstrates
list_services.py List and inspect all available services with their parameters
find_service_by_name.py Look up a specific service by name

Job Workflows

Script What it demonstrates
run_async_job.py Async job submission using request_job_async()
test_failed_service.py How to detect and handle a failed job

Artifacts

Script What it demonstrates
upload_artifact.py Upload a local file as an artifact
download_artifact.py Download artifact content to disk
list_artifacts.py Browse all artifacts with their metadata
Script What it demonstrates
search_aspect.py Query the Datafabric by schema and filter

Async & Parallel

Script What it demonstrates
batch_stress_test.py Submit many Batch-mode jobs in parallel and monitor
lambda_stress_test.py Stress-test a Lambda-mode service
locus_stress_test.py Parallel job submission with Locust load testing
run_crewai_agent.py Run a CrewAI agent deployed on IVCAP

See Also