The official Python SDK for Danube AI provides a clean, Pythonic interface for accessing services, tools, skills, and user identity through the Danube platform.
from danube import DanubeClient# Initialize with API key (or set DANUBE_API_KEY environment variable)with DanubeClient(api_key="dk_...") as client: # List available services services = client.services.list(limit=5) for service in services: print(f"{service.name}: {service.tool_count} tools") # Search for tools tools = client.tools.search("send email") # Execute a tool result = client.tools.execute( tool_name="Gmail - Send Email", parameters={ "to": "user@example.com", "subject": "Hello from Danube!" } ) if result.success: print(result.content) else: print(f"Error: {result.error}")
# List/search servicesservices = client.services.list(query="github", limit=10)# Get a specific serviceservice = client.services.get("service-uuid")# Get tools for a serviceresult = client.services.get_tools("service-uuid")if result.needs_configuration: print(f"Configure at: {result.configuration_url}")else: for tool in result.tools: print(tool.name)
# Search for skillsskills = client.skills.search("pdf processing")# Get full skill contentskill = client.skills.get(skill_id="skill-uuid")# or by nameskill = client.skills.get(skill_name="pdf-processing")print(f"Instructions:\n{skill.skill_md}")for script in skill.scripts: print(f"Script: {script.name}") print(script.content)
# List public workflowsworkflows = client.workflows.list(query="data pipeline", limit=10)# Get a specific workflowworkflow = client.workflows.get("workflow-uuid")# Execute a workflow with inputsexecution = client.workflows.execute( workflow_id="workflow-uuid", inputs={"query": "latest news"})print(f"Status: {execution.status}")for step in execution.step_results: print(f"Step {step.step_number}: {step.status}")# Get a past execution resultresult = client.workflows.get_execution("execution-uuid")print(f"Completed in {result.execution_time_ms}ms")# Create a workflowworkflow = client.workflows.create( name="My Pipeline", steps=[ { "step_number": 1, "tool_id": "tool-uuid", "tool_name": "Weather - Get Forecast", "description": "Fetch forecast", "input_mapping": {"city": "{{inputs.city}}"}, } ], visibility="private", tags=["weather"],)# Update a workflowupdated = client.workflows.update("workflow-uuid", name="Renamed Pipeline")# Delete a workflowclient.workflows.delete("workflow-uuid")
# Search the agent-friendly site directorysites = client.sites.search("payments", limit=10)# Get a site by IDsite = client.sites.get("site-uuid")print(f"{site.domain}: {site.status}")# Get a site by domainsite = client.sites.get_by_domain("stripe.com")if site.components.pricing: print(f"Pricing: {site.components.pricing}")