voltdbclient 14.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: voltdbclient
|
|
3
|
+
Version: 14.2.0
|
|
4
|
+
Summary: VoltDB python client
|
|
5
|
+
Author-email: Volt Active Data <support@voltactivedata.com>
|
|
6
|
+
Project-URL: Homepage, https://www.voltactivedata.com/
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Programming Language :: Python
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Provides-Extra: extras
|
|
13
|
+
Requires-Dist: pyjks; extra == "extras"
|
|
14
|
+
Requires-Dist: cryptography; extra == "extras"
|
|
15
|
+
Requires-Dist: python-gssapi; extra == "extras"
|
|
16
|
+
|
|
17
|
+
Description
|
|
18
|
+
|
|
19
|
+
The VoltDB Python client library is a native Python implementation of the VoltDB
|
|
20
|
+
wire protocol. It provides the functionality of connecting to a VoltDB server,
|
|
21
|
+
authenticating the client, and making procedure calls. The client supports
|
|
22
|
+
Python 3.6 or later.
|
|
23
|
+
|
|
24
|
+
The Python client library is a single file, voltdbclient.py, contained in the VoltDB distribution
|
|
25
|
+
tarball. This pypi package is provided for the convenience of users who don't need the
|
|
26
|
+
full VoltDB distribution.
|
|
27
|
+
|
|
28
|
+
-------
|
|
29
|
+
|
|
30
|
+
The core of the Python client library is the FastSerializer class. It manages
|
|
31
|
+
the connection to the server and serializes/deserializes the VoltDB primitive
|
|
32
|
+
types. There are higher level classes which wraps around the FastSerializer
|
|
33
|
+
class to handle compound objects, namely procedure, response, table, and
|
|
34
|
+
exception. VoltProcedure, VoltResponse, VoltTable, and VoltException classes
|
|
35
|
+
handles them, respectively. Note that none of the classes in the Python client
|
|
36
|
+
library is thread safe.
|
|
37
|
+
|
|
38
|
+
Each VoltDB primitive type is mapped to a Python primitive type. The following
|
|
39
|
+
table shows the mapping.
|
|
40
|
+
|
|
41
|
+
|VoltDB |Python |
|
|
42
|
+
|---------|--------|
|
|
43
|
+
|NULL |None |
|
|
44
|
+
|TINYINT |integer |
|
|
45
|
+
|SMALLINT |integer |
|
|
46
|
+
|INTEGER |integer |
|
|
47
|
+
|BIGINT |integer |
|
|
48
|
+
|FLOAT |float |
|
|
49
|
+
|STRING |string |
|
|
50
|
+
|DECIMAL |decimal |
|
|
51
|
+
|
|
52
|
+
Although Python does not distinguish between the different integer types, the
|
|
53
|
+
size of the integer being serialized needs to fit the corresponding type.
|
|
54
|
+
|
|
55
|
+
The common work flow is to create a FastSerializer object and connect to the
|
|
56
|
+
server. Then create a VoltProcedure object for each stored procedure you want to
|
|
57
|
+
call, passing the FastSerializer object to it. For each call, you will get a
|
|
58
|
+
VoltResponse object, which may or may not contain a list of VoltTable
|
|
59
|
+
objects. In case of failure, a VoltException object may be included.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
API
|
|
63
|
+
|
|
64
|
+
FastSerializer.VOLTTYPE_NULL
|
|
65
|
+
FastSerializer.VOLTTYPE_TINYINT
|
|
66
|
+
FastSerializer.VOLTTYPE_SMALLINT
|
|
67
|
+
FastSerializer.VOLTTYPE_INTEGER
|
|
68
|
+
FastSerializer.VOLTTYPE_BIGINT
|
|
69
|
+
FastSerializer.VOLTTYPE_FLOAT
|
|
70
|
+
FastSerializer.VOLTTYPE_STRING
|
|
71
|
+
FastSerializer.VOLTTYPE_TIMESTAMP
|
|
72
|
+
FastSerializer.VOLTTYPE_DECIMAL
|
|
73
|
+
FastSerializer.VOLTTYPE_DECIMAL_STRING
|
|
74
|
+
FastSerializer.VOLTTYPE_VOLTTABLE
|
|
75
|
+
VoltDB types.
|
|
76
|
+
|
|
77
|
+
FastSerializer(host, port, username, password, dump_file)
|
|
78
|
+
Create a connection to host (string) on port (integer). If username (string)
|
|
79
|
+
and password (string) is given, authenticate the client using them. If
|
|
80
|
+
dump_file (string) is given, all the data received from and sent to the
|
|
81
|
+
server will be written into the file pointed to by dump_file.
|
|
82
|
+
|
|
83
|
+
FastSerializer.close()
|
|
84
|
+
Closes the connection. No further use of the object is valid.
|
|
85
|
+
|
|
86
|
+
VoltProcedure(fser, name, paramtypes)
|
|
87
|
+
Create a procedure object which can be used to call the stored procedure
|
|
88
|
+
name (string) with parameters of types paramtypes (list). The parameter
|
|
89
|
+
types are defined in the FastSerializer class as VoltDB types. For parameter
|
|
90
|
+
of type array, you specify the type in the same way as primitive types. fser
|
|
91
|
+
is the FastSerializer object with a valid connection to the server.
|
|
92
|
+
|
|
93
|
+
VoltProcedure.call(params, response, timeout)
|
|
94
|
+
Make a stored procedure invocation with the parameters params (list). The
|
|
95
|
+
parameters has to match the types defined in the VoltProcedure
|
|
96
|
+
constructor. If a parameter is an array, pass it in as a list. If response
|
|
97
|
+
(bool) is given and False, the invocation will return None. If timeout
|
|
98
|
+
(float) is given, the invocation will wait for timeout seconds at most if
|
|
99
|
+
the server does not respond. A socket.timeout exception will be raised if
|
|
100
|
+
timeout seconds has elapsed. A successful invocation will return a
|
|
101
|
+
VoltReponse object.
|
|
102
|
+
|
|
103
|
+
VoltResponse.status
|
|
104
|
+
The status code (integer) for a stored procedure invocation. For a list of
|
|
105
|
+
status code, please refer to the VoltDB documentation.
|
|
106
|
+
|
|
107
|
+
VoltResponse.statusString
|
|
108
|
+
A human-friendly string of the meaning of the status code.
|
|
109
|
+
|
|
110
|
+
VoltResponse.roundtripTime
|
|
111
|
+
The round-trip time (integer) of the invocation in milliseconds.
|
|
112
|
+
|
|
113
|
+
VoltResponse.exception
|
|
114
|
+
The VoltException object in case of failure, may be None.
|
|
115
|
+
|
|
116
|
+
VoltResponse.tables
|
|
117
|
+
A list of VoltTable objects as the result of the invocation. May be None.
|
|
118
|
+
|
|
119
|
+
VoltException.type
|
|
120
|
+
The type of the VoltDB exception. Can be the following values,
|
|
121
|
+
VOLTEXCEPTION_NONE, VOLTEXCEPTION_EEEXCEPTION, VOLTEXCEPTION_SQLEXCEPTION,
|
|
122
|
+
VOLTEXCEPTION_CONSTRAINTFAILURE, VOLTEXCEPTION_GENERIC.
|
|
123
|
+
|
|
124
|
+
VoltException.message
|
|
125
|
+
A string explaining the exception.
|
|
126
|
+
|
|
127
|
+
VoltTable.columns
|
|
128
|
+
A list of VoltColumn objects, representing the columns in the table.
|
|
129
|
+
|
|
130
|
+
VoltTable.tuples
|
|
131
|
+
A list of rows in the table. A row a list of values deserialized in Python
|
|
132
|
+
types.
|
|
133
|
+
|
|
134
|
+
VoltColumn.type
|
|
135
|
+
The type of the column. A list of types is defined in the FastSerializer
|
|
136
|
+
class.
|
|
137
|
+
|
|
138
|
+
VoltColumn.name
|
|
139
|
+
The name of the column as a string.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
Example
|
|
143
|
+
|
|
144
|
+
The following example shows how to make a connection to a VoltDB server instance
|
|
145
|
+
running on port 21212 on localhost, and make a single call to the stored
|
|
146
|
+
procedure named "Select", which takes a single parameter of type string. Assume
|
|
147
|
+
the server is not secure, so that it does not require authentication.
|
|
148
|
+
|
|
149
|
+
>>> from voltdbclient import *
|
|
150
|
+
>>> client = FastSerializer("localhost", 21212)
|
|
151
|
+
>>> proc = VoltProcedure(client, "@SystemInformation", [FastSerializer.VOLTTYPE_STRING])
|
|
152
|
+
>>> response = proc.call(["OVERVIEW"])
|
|
153
|
+
>>> client.close()
|
|
154
|
+
>>> print (response)
|
|
155
|
+
|
|
156
|
+
The output will be a human-readable form of the VoltResponse object.
|
|
157
|
+
|
|
158
|
+
## Installation
|
|
159
|
+
|
|
160
|
+
You can install the package via **PyPI** or from **source**.
|
|
161
|
+
|
|
162
|
+
### Install from PyPI
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
pip install voltdbclient
|
|
166
|
+
```
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
voltdbclient.py,sha256=s5J9URW3Sn8ahD9e-phZgizok2BgFn4nNlpcfjnGsWs,75794
|
|
2
|
+
voltdbclient-14.2.0.dist-info/METADATA,sha256=lTp9kPLy_m2S-9LywOc_H-7k-2EjeZsOFbbC3pV1Dcw,6247
|
|
3
|
+
voltdbclient-14.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4
|
+
voltdbclient-14.2.0.dist-info/top_level.txt,sha256=KX-vE749KxtQFVAxImS-snhxy4eHzH5F4DGXY9blQ1U,13
|
|
5
|
+
voltdbclient-14.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
voltdbclient
|