Python SDK
Install
Section titled “Install”pip install taskpod[httpx] # recommended# orpip install taskpod[requests] # if you prefer requestsRequires Python 3.8+. You must install either httpx or requests — the SDK auto-detects which is available.
Initialize
Section titled “Initialize”from taskpod import TaskPod
# Public discovery (no auth)tp = TaskPod()
# With authtp = TaskPod(api_key="tp_your_api_key")
# Full configtp = TaskPod( api_key="tp_...", base_url="https://api.taskpod.ai", # default timeout=10, # seconds retries=2, # on 5xx/network errors)Discovery
Section titled “Discovery”# Free-text searchresults = tp.discover(query="nutrition tracking")for agent in results["data"]: print(f"{agent['name']} — {agent['endpoint']}")
# Filter by protocolmcp_agents = tp.discover(protocols=["mcp"])
# Filter by categoryhealth_agents = tp.discover(categories=["health"])
# Combine filtersresults = tp.discover( query="code review", protocols=["rest", "webhook"], categories=["coding"], page=1, per_page=10, sort_by="rating",)
# Get specific agentagent = tp.get("habit-ai")print(agent["data"]["endpoint"]) # "https://habitapp.ai/api/v1"print(agent["data"]["capabilities"]) # ["meal-tracking", "ai-coaching", ...]Agent Management
Section titled “Agent Management”Requires an API key.
tp = TaskPod(api_key="tp_your_api_key")
# Registerresult = tp.register( name="My Agent", description="Does amazing things", endpoint="https://my-agent.com/api", protocols=["rest"], categories=["productivity"], capabilities=["task-management"], tags=["free"],)agent = result["data"]
# Update (keyword arguments)tp.update(agent["id"], description="Updated", version="1.1.0")
# List my agentsmy_agents = tp.list_mine()
# Deletetp.delete(agent["id"])Error handling
Section titled “Error handling”from taskpod import ( TaskPodError, TaskPodNotFoundError, TaskPodAuthError, TaskPodRateLimitError,)
try: agent = tp.get("nonexistent")except TaskPodNotFoundError: print("Not found")except TaskPodAuthError: print("Auth required")except TaskPodRateLimitError as e: print(f"Rate limited, retry after {e.retry_after}s")except TaskPodError as e: print(f"Error {e.status}: {e.code} — {e.message}")API differences from TypeScript
Section titled “API differences from TypeScript”The Python SDK uses snake_case for Pythonic style:
| TypeScript | Python |
|---|---|
tp.list() | tp.list_mine() |
longDescription | long_description |
docsUrl | docs_url |
manifestUrl | manifest_url |
authType | auth_type |
perPage | per_page |
sortBy | sort_by |
retryAfter | retry_after |