Daytona Python SDK
The official Python SDK for creating and managing secure Daytona AI code sandboxes
Repository Health
Technical Analysis
Daytona is the official Python client for Daytona, a hosted sandbox platform for running AI-generated code in isolated, elastic “composable computers.” The SDK wraps sandbox lifecycle management (create, snapshot, stop, delete), file system operations, git operations, language server protocol access, and process/code execution behind both synchronous and native async APIs.
It lives in the daytona/clients monorepo alongside SDKs for other languages (Go, Java, Ruby, TypeScript) and the Daytona CLI, all maintained by Daytona Platforms Inc. The daytona PyPI package is the current, actively developed SDK — it supersedes the older daytona_sdk package, which now ships identical code during a deprecation window.
What You Get
- A
Daytona/AsyncDaytonaclient for creating, listing, and deleting sandboxes - Sandbox-scoped APIs for process/code execution, file system operations, and git commands
- Language server protocol (LSP) access for code intelligence inside a sandbox
- Ephemeral sandboxes, custom resource limits (CPU/memory/disk), and snapshot-based sandbox creation
- Object storage and computer-use (GUI automation) helpers alongside the core sandbox API
Common Use Cases
- Giving an AI agent a secure, isolated place to execute LLM-generated code
- Spinning up ephemeral sandboxes per user request in a code-execution-as-a-service product
- Running reproducible dev/test environments from a shared base image or snapshot
- Automating file, git, and process operations inside a remote sandbox from a Python backend
Under The Hood
Architecture: The SDK lives at sdk-python/ inside the daytona/clients monorepo, structured around a daytona/ package with parallel _sync and _async implementations sharing common models (daytona/common/), plus handle and internal modules wrapping the underlying HTTP/WebSocket API generated from Daytona’s OpenAPI spec (shared across the Go, Java, Ruby, and TypeScript SDKs in sibling directories). Tech Stack: Python 3.10+, built with Poetry, using httpx/httpx-ws/aiohttp for sync/async/WebSocket transport, Pydantic for models, and OpenTelemetry instrumentation baked in for tracing SDK calls. Code Quality: The tests/ directory has 25+ test modules mirroring the sync/async API surface (sandbox, filesystem, git, LSP, process, computer-use, object storage), plus dedicated end-to-end test files (test_e2e.py, test_async_e2e.py); the monorepo enforces per-package licensing via .licenserc.yaml and ships CLA/contribution docs for external contributors. API Design: The SDK mirrors the sync and async surfaces one-to-one (e.g. daytona.create() vs await async_daytona.create()), and models common operations as typed parameter objects (CreateSandboxFromImageParams, Resources) rather than long positional argument lists, keeping the common “create and run code” path to a handful of lines.
Used by 5 apps in this directory
agenta
Developer Tools · Devops · AI Development
The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.
Agno
Devops · AI Development · Automation
Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.
deepagents
AI Agents · AI Development
The batteries-included Python agent harness — planning, sub-agents, filesystem, shell, memory, and skills bundled in, built on LangGraph.
OpenHands
AI Code Assistants · AI Development
The self-hosted developer control center for running AI coding agents — locally, in Docker, on VMs, or across cloud backends — with automation workflows for GitHub, Slack, and more.
SurfSense
Search · AI Assistants
The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.