Daytona Python SDK

The official Python SDK for creating and managing secure Daytona AI code sandboxes

SDK
PyPI
v0.205.0
8stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
57/100Fair
Development Activity100
Maintenance100
Community16
Maturity12
Momentum0

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture76
Code Quality78
Innovation75
Learning Curve74

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/AsyncDaytona client 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.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search