DebuggAI Python SDK
Python SDK for the DebuggAI API. Provides a unified interface for E2E test generation, execution, and artifact management.
🤖 AI Agent Quick Start
For AI agents working with DebuggAI API:
from debuggai import DebuggAIClient
# Authenticate
client = DebuggAIClient.from_api_key(api_key)
# Core workflow: Create → Poll → Download → Analyze
suite = client.e2e.create_suite(repo_name="repo", repo_path="/path", commit_hash="hash")
completed = client.e2e.poll_suite(suite.uuid, timeout=300)
# Check status
if completed.status == "completed":
files = client.artifacts.download_suite_artifacts(suite.uuid, output_dir)
# Analyze test files...
elif completed.status == "failed":
# Handle failure...
Key Methods:
client.e2e.create_suite()- Generate E2E testsclient.e2e.poll_suite(uuid, timeout)- Wait for completionclient.artifacts.download_suite_artifacts(uuid, output_dir)- Get test filesclient.e2e.list_suites()- List all suitesclient.e2e.get_suite(uuid)- Get suite details
Authentication Types:
- API Key:
DebuggAIClient.from_api_key("key") - Token:
DebuggAIClient.from_token("token")
Error Handling:
from debuggai.exceptions import DebuggAIError, AuthenticationError, ValidationError
try:
suite = client.e2e.create_suite(...)
except AuthenticationError:
# Invalid credentials
except ValidationError:
# Invalid parameters
except DebuggAIError as e:
# Other API errors
print(f"Error: {e}")
Installation
pip install debuggai-sdk
Or install from source:
cd debuggai-sdk
pip install -e ".[dev]"
Quick Start
from debuggai import DebuggAIClient
# Create client
client = DebuggAIClient.from_api_key("your-api-key")
# Create E2E test suite
suite = client.e2e.create_suite(
repo_name="my-repo",
repo_path="/path/to/repo",
commit_hash="abc123",
)
# Poll for completion
completed = client.e2e.poll_suite(suite.uuid, timeout=300)
print(f"Suite status: {completed.status}")
# Download artifacts
from pathlib import Path
files = client.artifacts.download_suite_artifacts(
completed.uuid,
output_dir=Path("./artifacts"),
)
# Clean up
client.close()
Or use as context manager:
with DebuggAIClient.from_api_key("key") as client:
suite = client.e2e.create_suite(...)
Authentication
The SDK supports two authentication types:
- Bearer (default):
Authorization: Bearer <api_key> - Token:
Authorization: Token <api_key>
# Bearer auth (default)
client = DebuggAIClient.from_api_key("key")
# Token auth (for some endpoints)
client = DebuggAIClient.from_api_key("key", auth_type="token")
Services
E2E Service
# Create suite
suite = client.e2e.create_suite(
repo_name="my-repo",
repo_path="/path/to/repo",
commit_hash="abc123",
changes=[{"status": "modified", "file": "src/main.py"}],
)
# Get suite status
suite = client.e2e.get_suite(suite.uuid)
# Poll until complete
suite = client.e2e.poll_suite(suite.uuid, timeout=300, interval=5)
# List tests for a project
tests = client.e2e.list_tests("my-project")
# Trigger a run
run = client.e2e.create_run("my-project", target_url="http://localhost:3000")
# Poll run
run = client.e2e.poll_run(run.id)
Artifact Service
from pathlib import Path
# Download all artifacts
files = client.artifacts.download_suite_artifacts(
"suite-uuid",
output_dir=Path("./artifacts"),
)
# Download specific artifact types
files = client.artifacts.download_suite_artifacts(
"suite-uuid",
output_dir=Path("./artifacts"),
include=["scripts", "recordings"], # Skip results
)
Error Handling
from debuggai import DebuggAIClient
from debuggai.exceptions import (
AuthenticationError,
NotFoundError,
RateLimitError,
TimeoutError,
)
client = DebuggAIClient.from_api_key("key")
try:
suite = client.e2e.create_suite(...)
except AuthenticationError:
print("Invalid API key")
except RateLimitError as e:
print(f"Rate limited, retry after {e.retry_after}s")
except TimeoutError as e:
print(f"Operation timed out after {e.elapsed}s")
except NotFoundError:
print("Resource not found")
Configuration
from debuggai import DebuggAIClient
from debuggai.config import DebuggAIConfig
config = DebuggAIConfig(
api_key="your-key",
base_url="https://api.debugg.ai",
auth_type="bearer",
timeout=30.0,
max_retries=3,
retry_delay=1.0,
)
client = DebuggAIClient(config=config)
Design Principles
- No magic values - All configuration is explicit
- No env var discovery - API key must be passed explicitly
- Typed exceptions - Clear error handling
- Retry logic - Automatic retries for transient failures
- Consistent auth - Handles Bearer/Token formats correctly
⏺ The Testing Philosophy
The Process
- Investigate Why Tests Missed It
- Write Test That FAILS
- Fix The Code
- Test Now PASSES
The Philosophy
Never fix a bug you can't reproduce in a test.
Metadata
Release files for debuggai 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| debuggai-0.2.0.tar.gz | 60.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| debuggai-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 95.8 kB
Release files / debuggai-0.2.0.tar.gz
| Download URL | debuggai-0.2.0.tar.gz |
|---|---|
| Size | 60.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf9ac6ac748eeb0fc9608ed2d86d4fec565f844e15583f5bcc82bf899ac3cdb0
|
|
BLAKE2b-256 checksum How to use checksums |
f9623306fb67bc977432b635b23604649eb5b3c8b9aea3b3b3955fac1bd28073
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / debuggai-0.2.0-py3-none-any.whl
| Download URL | debuggai-0.2.0-py3-none-any.whl |
|---|---|
| Size | 35.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f3ad8dfbf479423aebdf7dfe54cfe563eef49684709546a9637e01a436bf88b
|
|
BLAKE2b-256 checksum How to use checksums |
0071748025131a0899382e7f5ddb458c4998dcc573868547aea592b6ae7e7b0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Security for debuggai 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.