@@ -2,190 +2,106 @@ GridDB Python Client
2
2
3
3
## Overview
4
4
5
- GridDB Python Client is developed using GridDB C Client and [ SWIG] ( http://www.swig.org/ ) (Simplified Wrapper and Interface Generator).
5
+ GridDB Python Client has been renewed.
6
+
7
+ New GridDB Python Client is developed using GridDB Java API(Java Client), [ JPype] ( https://github.com/jpype-project/jpype ) and [ Apache Arrow] ( https://arrow.apache.org/ ) .
6
8
7
9
## Operating environment
8
10
9
11
Building of the library and execution of the sample programs have been checked in the following environment.
10
12
11
-
12
- OS: Ubuntu 24.04(x64) (gcc 11)
13
- SWIG: 4.0.2
13
+ OS: Ubuntu 22.04 (x64) / RockyLinux 9.4 (x64) / Windows 11 (x64) / MacOS 12 (x86_64)
14
14
Python: 3.12
15
- GridDB C client: V5.6 CE
16
- GridDB server: V5.6 CE
15
+ Java: 8
16
+ GridDB Java API: V5.8 CE
17
+ GridDB server: V5.8 CE, Ubuntu 22.04 (x64)
17
18
18
- OS: RockyLinux 9.4(x64) (gcc 11)
19
- SWIG: 4.0.2
20
- Python: 3.12
21
- GridDB C client: V5.6 CE
22
- GridDB server: V5.6 CE
19
+ ## QuickStart
23
20
24
- OS: Windows 11(x64) (VS2017)
25
- SWIG: 4.0.2
26
- Python: 3.12
27
- GridDB C client: V5.6 CE
28
- GridDB server: V5.6 CE, Ubuntu 24.04
21
+ This repository includes GridDB Python Client and GridDB JavaAPI Adapter for Apache Arrow.
22
+ GridDB Python Client needs GridDB JavaAPI Adapter for Apache Arrow.
29
23
30
- OS: MacOS 12
31
- SWIG: 4.0.2
32
- Python: 3.12
33
- GridDB C client: V5.6 CE
34
- GridDB server: V5.6 CE, Ubuntu 24.04
35
-
36
- ## QuickStart (CentOS, Ubuntu)
37
24
### Preparations
38
25
39
- Install SWIG as below.
40
-
41
- $ wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz
42
- $ tar xvfz v4.0.2.tar.gz
43
- $ cd swig-4.0.2
44
- $ ./autogen.sh
45
- $ ./configure
46
- $ make
47
- $ sudo make install
48
-
49
- Note: If CentOS, you might need to install pcre in advance.
50
- $ sudo yum install pcre2-devel.x86_64
51
-
52
- Install [ GridDB Server] ( https://github.com/griddb/griddb ) and [ C Client] ( https://github.com/griddb/c_client ) . (Note: If you build them from source code, please use GCC 4.8.5.)
53
-
54
- Set CPATH and LIBRARY_PATH.
55
-
56
- export CPATH=$CPATH:<Python header file directory path>
57
-
58
- export LIBRARY_PATH=$LIBRARY_PATH:<C client library file directory path>
59
-
60
- Install Pandas and Numpy as below:
61
-
62
- $ python3 -m pip install numpy
63
- $ python3 -m pip install pandas
26
+ (GridDB JavaAPI Adapter for Apache Arrow)
64
27
65
- ### Build and Run
28
+ $ cd java
29
+ $ mvn install
30
+ $ cd ..
66
31
67
- 1. Execute the command on project directory.
32
+ The following file is created under ` target/ ` folder.
33
+ - gridstore-arrow-X.Y.Z.jar
68
34
69
- $ make
35
+ (GridDB Python Client)
70
36
71
- 2. Set the PYTHONPATH variable for griddb Python module files.
37
+ $ cd python
38
+ $ python -m pip install .
39
+ $ cd ..
72
40
73
- $ export PYTHONPATH=$PYTHONPATH:< installed directory path>
41
+ [ JPype ] ( https://pypi.org/project/jpype1/ ) , [ pyarrow ] ( https://pypi.org/project/pyarrow/ ) , GridDB Python Client(griddb_python) are installed.
74
42
75
- 3. Import griddb_python in Python.
76
-
77
- ### How to run sample
43
+ ### How to run sample (on Linux, Ubuntu, MacOS)
78
44
45
+ Install [ GridDB Server] ( https://github.com/griddb/griddb ) .
79
46
GridDB Server need to be started in advance.
80
47
81
- 1. Set LD_LIBRARY_PATH
82
-
83
- $ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:<C client library file directory path>
84
-
85
- 2. The command to run sample
86
-
87
- $ python3 sample/sample1.py <GridDB notification address> <GridDB notification port>
88
- <GridDB cluster name> <GridDB user> <GridDB password>
89
- -->Person: name=name02 status=False count=2 lob=[65, 66, 67, 68, 69, 70, 71, 72, 73, 74]
90
-
91
- ## QuickStart (Windows)
92
-
93
- ### Using source code
94
-
95
- Please refer to [ Cmake Build Guide] ( https://griddb.github.io/python_client/cmake_build_guide.html )
96
-
97
- ### Using MSI
98
-
99
- #### Install Python Client
100
-
101
- Install the MSI package, the package is extracted into C:/Program Files/griddb/Python Client/X.X.X folder.
102
-
103
- #### Execute a Python client sample program
104
-
105
- * Put sample1.py into C:/Program Files/GridDB/Python Client/X.X.X
106
- * Run following command to execute program
107
- ```
108
- <PATH_TO>/python.exe sample1.py <GridDB notification address> <GridDB notification port>
109
- <GridDB cluster name> <GridDB user> <GridDB password>
110
- ```
48
+ ``` sh
49
+ $ cd sample
50
+ ```
111
51
112
- Note: X.X.X is the software version.
52
+ 1 . Download GridDB Java API on sample folder
113
53
114
- ## QuickStart (MacOS)
115
- ### Preparations
116
-
117
- Install SWIG as below.
118
-
119
- $ wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz
120
- $ tar xvfz v4.0.2.tar.gz
121
- $ cd swig-4.0.2
122
- $ ./autogen.sh
123
- $ ./configure
124
- $ make
125
- $ sudo make install
126
-
127
- Note: If MacOS, you might need to install pcre in advance.
128
- $ brew install pcre
129
-
130
- Install [GridDB Server](https://github.com/griddb/griddb) and [C Client](https://github.com/griddb/c_client). (Note: If you build them from source code, please use clang 11.0.0)
131
-
132
- Set CPATH and LIBRARY_PATH.
133
-
134
- export CPATH=$CPATH:<Python header file directory path>
135
-
136
- export LIBRARY_PATH=$LIBRARY_PATH:<C client library file directory path>
137
-
138
- Install Pandas and Numpy as below:
139
-
140
- $ python3 -m pip install numpy
141
- $ python3 -m pip install pandas
142
-
143
- ### Build and Run
144
-
145
- 1. Execute the command on project directory.
146
-
147
- $ make
54
+ ``` sh
55
+ $ curl -L -o gridstore.jar https://repo1.maven.org/maven2/com/github/griddb/gridstore/5.8.0/gridstore-5.8.0.jar
56
+ ```
148
57
149
- 2. Set the PYTHONPATH variable for griddb Python module files.
58
+ 2 . Place GridDB JavaAPI Adapter for Apache Arrow on sample folder
150
59
151
- $ export PYTHONPATH=$PYTHONPATH:<installed directory path>
60
+ ``` sh
61
+ $ cp ../java/target/gridstore-arrow-X.Y.Z.jar gridstore-arrow.jar
62
+ ```
152
63
153
- 3. Import griddb_python in Python.
64
+ 3 . Run sample
154
65
155
- ### How to run sample
66
+ ``` sh
67
+ $ python3 sample1.py < GridDB notification address> < GridDB notification port>
68
+ < GridDB cluster name> < GridDB user> < GridDB password>
69
+ --> Person: name=name02 status=False count=2 lob=[65, 66, 67, 68, 69, 70, 71, 72, 73, 74]
70
+ ```
156
71
157
- GridDB Server need to be started in advance.
158
-
159
- 1. Set DYLD_LIBRARY_PATH
160
-
161
- export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:<C client library file directory path>
162
-
163
- 2. The command to run sample
72
+ Note:
164
73
165
- $ python3 sample/sample1.py <GridDB notification address> <GridDB notification port>
166
- <GridDB cluster name> <GridDB user> <GridDB password>
167
- -->Person: name=name02 status=False count=2 lob=[65, 66, 67, 68, 69, 70, 71, 72, 73, 74]
74
+ Please insert the following description in python code.
75
+ ``` sh
76
+ import jpype
77
+ jpype.startJVM(classpath=[" ./gridstore.jar" , " ./gridstore-arrow.jar" ])
78
+ import griddb_python as griddb
79
+ ```
80
+ When you set the path of gridstore.jar and gridstore-arrow.jar into the environment variable "CLASSPATH",
81
+ You can use GridDB Python Client without "import jpype" and "startJVM()" like old GridDB Python Client.
82
+
83
+ ``` sh
84
+ $ export CLASSPATH=$CLASSPATH :./gridstore.jar:./gridstore-arrow.jar
85
+ ```
86
+ ``` sh
87
+ import griddb_python as griddb
88
+ ```
168
89
169
90
## Function
170
91
171
- (available )
172
- - STRING, BOOL, BYTE, SHORT, INTEGER, LONG, FLOAT, DOUBLE, TIMESTAMP, BLOB type for GridDB
173
- - put single row, get row with key
174
- - normal query, aggregation with TQL
92
+ (Available )
93
+ - STRING, BOOL, BYTE, SHORT, INTEGER, LONG, FLOAT, DOUBLE, TIMESTAMP(milli-second) , BLOB type for GridDB
94
+ - Put single row, get row with key
95
+ - Normal query, aggregation with TQL
175
96
- Multi-Put/Get/Query (batch processing)
176
- - Array type for GridDB
177
- - timeseries-specific function, affinity
97
+ - Compsite RowKey, Composite Index GEOMETRY type and TIMESTAP(micro/nano-second) type [ since Python Client V5.8]
98
+ - Put/Get/Fetch with Apache Arrow [ since Python Client V5.8]
99
+ - Operations for Partitioning table [ since Python Client V5.8]
178
100
179
- (not available)
180
- - GEOMETRY type for GridDB
181
-
182
- Please refer to the following files for more detailed information.
183
- - [Python Client API Reference](https://griddb.github.io/python_client/PythonAPIReference.htm)
184
-
185
- Note:
186
- 1. The current API might be changed in the next version. e.g. ContainerInfo
187
- 2. When you install C Client with RPM or DEB, you don't need to set LIBRARY_PATH and LD_LIBRARY_PATH.
188
- 3. There is [Python Client Package for only Python 3.10 (Linux, MacOS) on The Python Package Index (PyPI)](https://pypi.org/project/griddb-python/) .
101
+ (Not available compared to Python Client V0.8)
102
+ - Array type for GridDB
103
+ - Timeseries-specific function
104
+ - Implicit data type conversion
189
105
190
106
## Community
191
107
@@ -199,3 +115,7 @@ Note:
199
115
## License
200
116
201
117
GridDB Python Client source license is Apache License, version 2.0.
118
+
119
+ ## Trademarks
120
+
121
+ Apache Arrow, Arrow are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
0 commit comments