This is an automated email from the ASF dual-hosted git repository.

leirui pushed a commit to branch rel/0.9
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 3b386f2551bfc15ae1597a7442aec4065a82dc5f
Author: Lei Rui <[email protected]>
AuthorDate: Thu Dec 26 15:41:09 2019 +0800

    Update docs about client python
---
 client-py/compile.bat                              |  6 +--
 client-py/compile.sh                               |  2 +-
 client-py/readme.md                                |  2 +-
 client-py/src/client_example.py                    |  1 +
 .../4-Client/4-Programming - Other Languages.md    | 53 +++++++++++++++++-----
 5 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/client-py/compile.bat b/client-py/compile.bat
index a9081c0..329a37a 100644
--- a/client-py/compile.bat
+++ b/client-py/compile.bat
@@ -18,11 +18,11 @@
 @REM
 
 @echo off
-set THRIFT_EXE=C:\bin\thrift-0.12.0.exe
+set THRIFT_EXE=D:\software\Thrift\thrift-0.13.0.exe
 set BAT_DIR=%~dp0
 set THRIFT_SCRIPT=%BAT_DIR%..\service-rpc\src\main\thrift\rpc.thrift
-set THRIFT_OUT=%BAT_DIR%target
+set THRIFT_OUT=%BAT_DIR%target\iotdb
 
-rm -rf %THRIFT_OUT%
+rmdir /Q /S %THRIFT_OUT%
 mkdir %THRIFT_OUT%
 %THRIFT_EXE% -gen py -out %THRIFT_OUT%  %THRIFT_SCRIPT%
diff --git a/client-py/compile.sh b/client-py/compile.sh
index 628ca82..85107fc 100644
--- a/client-py/compile.sh
+++ b/client-py/compile.sh
@@ -21,7 +21,7 @@
 export THRIFT_EXE=thrift
 export SH_DIR=$(dirname $0)/
 export THRIFT_SCRIPT=${SH_DIR}../service-rpc/src/main/thrift/rpc.thrift
-export THRIFT_OUT=${SH_DIR}target
+export THRIFT_OUT=${SH_DIR}target/iotdb
 
 rm -rf ${THRIFT_OUT}
 mkdir ${THRIFT_OUT}
diff --git a/client-py/readme.md b/client-py/readme.md
index 7fb4718..576cae7 100644
--- a/client-py/readme.md
+++ b/client-py/readme.md
@@ -35,7 +35,7 @@ http://thrift.apache.org/docs/install/
 
 ## Compile the thrift library
 If you have added Thrift executable into your path, you may just run 
`client-py/compile.sh` or
- `client-py/compile.bat`, or you will have to modify it to set variable 
`THRIFT_EXE` to point to
+ `client-py\compile.bat`, or you will have to modify it to set variable 
`THRIFT_EXE` to point to
 your executable. This will generate thrift sources under folder `target`, you 
can add it to your
 `PYTHONPATH` so that you would be able to use the library in your code. Notice 
that the scripts
 locate the thrift source file by relative path, so if you move the scripts 
else where, they are
diff --git a/client-py/src/client_example.py b/client-py/src/client_example.py
index 8749d74..9e4a4b5 100644
--- a/client-py/src/client_example.py
+++ b/client-py/src/client_example.py
@@ -18,6 +18,7 @@
 
 import sys, struct
 
+# If you generate IoTDB python library manually, add it to your python path
 sys.path.append("../target")
 
 from thrift.protocol import TBinaryProtocol
diff --git a/docs/Documentation/UserGuide/4-Client/4-Programming - Other 
Languages.md b/docs/Documentation/UserGuide/4-Client/4-Programming - Other 
Languages.md
index 742d952..0d34de8 100644
--- a/docs/Documentation/UserGuide/4-Client/4-Programming - Other Languages.md  
+++ b/docs/Documentation/UserGuide/4-Client/4-Programming - Other Languages.md  
@@ -7,9 +7,9 @@
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
-
+    
         http://www.apache.org/licenses/LICENSE-2.0
-
+    
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,28 +18,57 @@
     under the License.
 
 -->
+
 # Chapter 4: Client
 
 # Programming - Other Languages
+
 ## Python API
-### Introduction
+
+### 1. Introduction
+
 This is an example of how to connect to IoTDB with python, using the thrift 
rpc interfaces. Things will be a bit different
 on Linux or Windows, we will introduce how to operate on the two systems 
separately.
 
-### Prerequisites
+### 2. Prerequisites
+
 python3.7 or later is preferred.
 
 You have to install Thrift (0.11.0 or later) to compile our thrift file into 
python code. Below is the official
-tutorial of installation:
+tutorial of installation: 
+
 ```
 http://thrift.apache.org/docs/install/
 ```
 
-### Compile
-If you have added Thrift executable into your path, you may just run 
`compile.sh` or `compile.bat`, or you will have to
-modify it to set variable `THRIFT_EXE` to point to your executable. This will 
generate thrift sources under folder `target`,
-you can add it to your `PYTHONPATH` so that you would be able to use the 
library in your code.
+### 3. How to Get the Python Library
+
+#### Option 1: pip install
+
+You can find the Apache IoTDB Python Client API package on 
https://pypi.org/project/apache-iotdb/.
+
+The download command is:
+
+```
+pip install apache-iotdb
+```
+
+#### Option 2: use the compile script we provided
+
+If you have added Thrift executable into your path, you may just run 
`client-py/compile.sh` or
+ `client-py\compile.bat`, or you will have to modify it to set variable 
`THRIFT_EXE` to point to
+your executable. This will generate thrift sources under folder `target`, you 
can add it to your
+`PYTHONPATH` so that you would be able to use the library in your code. Notice 
that the scripts
+locate the thrift source file by relative path, so if you move the scripts 
else where, they are
+no longer valid.
+
+#### Option 3: basic usage of thrift
+
+Optionally, if you know the basic usage of thrift, you can only download the 
thrift source file in
+`service-rpc\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out 
./target/iotdb rpc.thrift` 
+to generate the python library.
+
+### 4. Use Example
 
-### Example
-We provided an example of how to use the thrift library to connect to IoTDB in 
`src\client_example.py`, please read it 
-carefully before you write your own code.
+We provided an example of how to use the thrift library to connect to IoTDB in 
`client-py/src
+/client_example.py`, please read it carefully before you write your own code.

Reply via email to