Python SDK
A thin, dependency-free client for the /analyze endpoint. One call tests an app and returns root-caused bugs — each failing case resolved to its backend cause via trace_id.
bash
pip install upliftr # stdlib only, no runtime depsSource:
sdk/pythonin the repo. Point it at any Upliftr deployment — your own self-hosted engine, or an OEM's.
Usage
python
from upliftr import Upliftr
up = Upliftr("https://YOUR-UPLIFTR", token="tw_...")
result = up.analyze("https://staging.myapp.com")
if result.passed:
print("all good")
else:
for bug in result.bugs():
print(f"❌ {bug.title} ({bug.status})")
print(f" why: {bug.why}")
print(f" backend cause: {bug.backend_cause} [{bug.confidence}]")
print(f" suggested fix: {bug.suggested_fix}")
print(f" trace_id: {bug.trace_id}")Reference
Upliftr(base_url, token, timeout=900)
Point at any Upliftr deployment (no /api/v1 suffix). token is a tw_… org-scoped API token. timeout is in seconds (a sync analyze can run minutes).
up.analyze(app_url, *, ...) -> AnalyzeResult
| Arg | Meaning |
|---|---|
app_url | the app to test |
auth | {username, password, login_path} to log in first |
exhaustive | deeper coverage (default True) |
file_issues | "github" | "gitlab" | "jira" | "native" |
log_backend | per-request server-log config (see server logs) |
anthropic_key | per-request BYOK key |
mode | "sync" (wait) or "async" (returns a run_id) |
timeout_s | sync wait budget |
AnalyzeResult
.run_id, .status, .summary, .passed, .raw (full JSON), and:
.bugs()→ a list ofBug, one per failing/broken case, each with:.title,.status,.why,.category,.backend_cause,.suggested_fix,.confidence,.trace_id,.evidence.
Errors
Any non-2xx or transport failure raises UpliftrError with the status + detail.
python
from upliftr import Upliftr, UpliftrError
try:
up.analyze("https://x")
except UpliftrError as e:
print("analyze failed:", e)