Python SDK for the Harness Platform API
958
Production-grade Python Docker image for the Harness Platform SDK — a fully-typed API client for Harness platform resources. Built with Pydantic v2, httpx, and enterprise-grade retry logic for reliable platform interactions.
# Pull the latest image
docker pull harnesssolutionfactory/harness-platform-sdk:latest
# Run Python with the SDK
docker run --rm harnesssolutionfactory/harness-platform-sdk:latest -c "from harness_platform_sdk import HarnessClient; print('SDK ready')"
# Use a mounted script
docker run --rm -v $(pwd)/script.py:/app/script.py harnesssolutionfactory/harness-platform-sdk:latest /app/script.py
The SDK provides typed access to:
✅ Single Entry Point — All APIs via HarnessClient
✅ Automatic Retry — Built-in retry on 429 (rate limit) and 503 (service unavailable) with exponential backoff
✅ Scope Resolution — Automatic account/org/project context merging
✅ Type Safety — Full Pydantic v2 validation
✅ Error Handling — Explicit exception hierarchy (AuthError, ApiError, ScopeNotSetError)
✅ Pagination Support — OFFSET and CURSOR-based pagination
from harness_platform_sdk import HarnessClient
# Initialize client
client = HarnessClient(
api_key="your-api-key",
account_id="your-account-id",
default_org="your-org",
default_project="your-project"
)
# Use context manager for automatic cleanup
with client:
orgs = client.organizations.list()
for org in orgs:
print(f"Organization: {org.identifier}")
The SDK accepts configuration via:
Environment Variables
HARNESS_API_KEY — API key for authenticationHARNESS_ACCOUNT_ID — Account identifierHARNESS_BASE_URL — Platform URL (default: https://app.harness.io)Constructor Arguments
HarnessClient(
api_key="key",
account_id="acc",
default_org="org",
default_project="proj",
base_url="https://app.harness.io",
timeout=30.0,
max_retries=3,
retry_enabled=True,
verify_ssl=True
)
HarnessConfig Object
from harness_platform_sdk import HarnessConfig, HarnessClient
config = HarnessConfig(api_key="...", account_id="...")
client = HarnessClient(config=config)
The SDK provides explicit error types:
SSL_VERIFY_X509_STRICT=true)Image tags follow harness-platform-sdk:<version>, corresponding to PyPI releases. Each image is tagged with:
1.0.0)sha-a1b2c3d)latest (current stable)For issues, documentation, or questions:
Maintained by: Harness
License: BUSL-1.1
Last Updated: 2026-09-21
Content type
Image
Digest
sha256:82f9ec91c…
Size
34.4 MB
Last updated
about 14 hours ago
docker pull harnesssolutionfactory/harness-platform-sdk