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

# Python SDK 快速入门

本指南介绍如何开始使用 Cobo Payments Python SDK，它允许您使用 Python 编程语言将 Cobo 支付服务集成到您的现有 App 中。

要了解使用 Payments API 所需的初始设置步骤，请参阅[发送您的第一个 API 请求](/payments/cn/developer-tools/get-started-with-api)。

您可以访问 [GitHub](https://github.com/CoboGlobal/cobo-waas2-python-sdk/) 查看 SDK 的源代码。

## 前提条件

* 您已安装 Python 3.7 或更新版本。
* 按照[开发环境前置准备](/payments/cn/guides/preparation)中的说明设置您的 Cobo 账户并创建您的团队。如果已经设置了团队，请让您的团队管理员邀请您加入团队。
* 按照[发送您的第一个 API 请求](/payments/cn/developer-tools/get-started-with-api)中的说明，生成 API Key 和 API Secret，并在 Cobo Portal 上注册了 API Key。

## 安装 SDK

1. 使用 pip install 命令安装 SDK。
   打开终端窗口并运行以下命令：

   ```shell theme={null}
   pip install cobo-waas2=={VERSION}
   ```

<Note>将 \{VERSION} 替换为最新版本号，例如 `1.2.0`。从 [GitHub 仓库](https://github.com/CoboGlobal/cobo-waas2-python-sdk/tags)获取最新版本号。</Note>

2. 在您的项目文件中按如下方式导入包：

   ```python theme={null}
   import cobo_waas2
   ```

## 配置 API Key 和 HTTP Host

您可以参考 SDK 仓库中的 [configuration.py 文件](https://github.com/CoboGlobal/cobo-waas2-python-api/blob/master/cobo_waas2/configuration.py)了解所有支持的配置参数。

```python theme={null}
configuration = cobo_waas2.Configuration(

  # 将 `<YOUR_API_SECRET>` 替换为您的 API Secret。
  api_private_key="<YOUR_API_SECRET>",

  # 要使用开发环境，将主机设置为 `https://api.dev.cobo.com/v2`。
  # 要使用生产环境，将主机设置为 `https://api.cobo.com/v2`。
  host="https://api.dev.cobo.com/v2"

)
```

## 示例代码

API 操作级别的文档和示例代码请参照 Payments API SDK GitHub 仓库内的 [docs](https://github.com/CoboGlobal/cobo-waas2-python-api/tree/master/docs) 文件夹。
