luchunliang commented on code in PR #983:
URL: https://github.com/apache/inlong-website/pull/983#discussion_r1773191791


##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/sdk/dataproxy-sdk/python.md:
##########
@@ -0,0 +1,138 @@
+---
+title: Python SDK
+sidebar_position: 5
+---
+
+## 新建数据接入
+在 Dashboard 或者通过命令行工具创建数据接入,数据源类型使用 `Auto Push` (自主推送)。
+
+## 引入 Python SDK
+Python SDK 通过封装 C++ SDK 构建得到,对外暴露相关接口。运行时调用底层 C++ SDK 实现相关操作(如发送、关闭等)。
+因为底层是基于 C++ SDK 运行的,与系统 C++ 环境高度绑定,如果提供的软件包使用的 C++ 环境与用户系统环境不完全一致,可能会导致运行报错。
+首先需要从源码自行编译,见 [C++ SDK 
编译使用](https://github.com/apache/inlong/tree/master/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-cpp)。
+若成功编译,会在 dataproxy-sdk-cpp/release/lib 目录下发现静态库文件 dataproxy_sdk.a 。
+进入 Python SDK 
目录[dataproxy-sdk-python](https://github.com/apache/inlong/tree/master/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-python),依次执行以下命令:
+```shell
+chmod +x ./build.sh
+./build.sh
+```
+当.so文件生成时,您会看到以下消息,您可以选择进入.so文件的目标目录。默认情况下,.so文件将被复制到系统python site-packages目录。
+```shell
+Your system's Python site-packages directory is: xxx/xxx
+Enter the target directory for the .so files (Press Enter to use the default 
site-packages directory):
+```
+构建过程完成后,您可以在 Python 项目中导入该软件包,使用InLong DataProxy SDK 上报数据。
+```shell
+import inlong_dataproxy
+```
+> **Note**: 当 C++ SDK 或您正在使用的 Python 版本更新时,您需要按照上述步骤重新构建它。
+
+## 数据上报流程
+引入 SDK 后,可以通过调用 SDK 的`send`相关接口进行单条(批量)数据的上报,发送 demo 可参考 
[send_demo.py](https://git.woa.com/InLong/SyncWithGitHub/tree/internal-dev/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-python/demo)
 。整体流程包括以下三个步骤:
+
+### 创建 SDK实例
+
+SDK 支持进程创建1个SDK实例,多线程安全,也支持进程创建多个SDK实例,各个SDK实例相互独立,各个SDK实例也线程安全:

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to