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

# インストール

XDK Python SDK は GitHub リポジトリから直接取得し、`pip` でインストールできます。

<div id="prerequisites">
  ## 前提条件
</div>

* Python 3.8 以降
* 仮想環境用の `pip` および `venv`（推奨）

<div id="quick-install">
  ## クイックインストール
</div>

GitHub のサブディレクトリにある XDK をインストールします。

```bash theme={null}
pip install xdk
```

これにより、`main` ブランチから最新の生成済みバージョンが取得されます。

<div id="development-install">
  ## 開発用インストール
</div>

開発やコントリビュートを行う場合は、以下の手順に従ってください。

1. リポジトリをクローンします:
   ```bash theme={null}
   git clone https://github.com/xdevplatform/xdk.git
   cd xdk/python
   ```
2. 依存関係を編集可能（editable）モードでインストールします:
   ```bash theme={null}
   pip install -e .
   ```
   これにより、SDK とその実行時依存関係がインストールされます。
3. （任意）テスト／Lint 用の開発依存関係をインストールします:
   ```bash theme={null}
   pip install -e .[dev]
   ```

<div id="verification">
  ## 検証
</div>

インストールを確認します:

```python theme={null}
import xdk
print(xdk.__version__)  # XDKのバージョンを出力します
```

**注:** XDK は OpenAPI 仕様から自動生成されているため、変更点がないか必ず [X API changelog](https://docs.x.com/changelog) とリポジトリ内の XDK リリースノートを確認してください。
Python XDK を使った詳細なコード例については、[コードサンプルの GitHub リポジトリ](https://github.com/xdevplatform/samples/tree/main/python) を参照してください。
