> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandboxes Python client

> Python SDK for creating and managing CoreWeave sandbox environments.

`cwsandbox` Python クライアントは、CoreWeave のサンドボックス環境を作成および管理するための高レベルな SDK です。統一された API で、同期と非同期の両方のワークフローをサポートしています。

<h2 id="installation">
  インストール
</h2>

```bash theme={"system"}
uv pip install cwsandbox
```

<h2 id="quick-start">
  クイックスタート
</h2>

サンドボックスを作成し、コマンドを実行して、結果を取得します：

```python theme={"system"}
from cwsandbox import Sandbox

# 自動クリーンアップ用のコンテキストマネージャー
with Sandbox.run(container_image="python:3.11") as sb:
    result = sb.exec(["python", "-c", "print(2 + 2)"]).result()
    print(result.stdout)  # 4
```

同じ API は Async コンテキストでも使用できます。

```python theme={"system"}
from cwsandbox import Sandbox

async with Sandbox.run() as sb:
    result = await sb.exec(["python", "-c", "print(2 + 2)"])
    print(result.stdout)  # 4
```

<h2 id="next-steps">
  次のステップ
</h2>

<CardGroup cols={3}>
  <Card title="はじめに" icon="rocket" href="/ja/products/sandboxes/get-started">
    認証を行い、SDK を使って最初のサーバーレスサンドボックスを実行します。
  </Card>

  <Card title="チュートリアル" icon="graduation-cap" href="/ja/products/sandboxes/client/tutorial/configuration">
    SDK を使った設定、コマンドの実行、ファイル操作、クリーンアップの手順をステップごとに説明します。
  </Card>

  <Card title="ガイド" icon="book" href="/ja/products/sandboxes/client/guides/sandbox-lifecycle">
    ライフサイクル管理、ファイル操作、実行パターン、トラブルシューティングなど、特定のトピックについて詳しく説明します。
  </Card>
</CardGroup>
