valkey-glide 1.3.5rc1__cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 1.3.5rc3__cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.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.

Potentially problematic release.


This version of valkey-glide might be problematic. Click here for more details.

Files changed (32) hide show
  1. glide/__init__.py +7 -11
  2. glide/async_commands/bitmap.py +85 -94
  3. glide/async_commands/cluster_commands.py +122 -301
  4. glide/async_commands/command_args.py +6 -7
  5. glide/async_commands/core.py +696 -1281
  6. glide/async_commands/server_modules/ft.py +14 -83
  7. glide/async_commands/server_modules/ft_options/ft_aggregate_options.py +8 -15
  8. glide/async_commands/server_modules/ft_options/ft_create_options.py +11 -23
  9. glide/async_commands/server_modules/ft_options/ft_profile_options.py +7 -12
  10. glide/async_commands/server_modules/ft_options/ft_search_options.py +6 -12
  11. glide/async_commands/server_modules/glide_json.py +43 -134
  12. glide/async_commands/server_modules/json_batch.py +127 -157
  13. glide/async_commands/sorted_set.py +29 -39
  14. glide/async_commands/standalone_commands.py +96 -193
  15. glide/async_commands/stream.py +87 -94
  16. glide/async_commands/{batch.py → transaction.py} +970 -1380
  17. glide/config.py +105 -165
  18. glide/constants.py +4 -8
  19. glide/glide.cpython-310-aarch64-linux-gnu.so +0 -0
  20. glide/glide_client.py +11 -84
  21. glide/logger.py +1 -1
  22. glide/protobuf/command_request_pb2.py +15 -15
  23. glide/protobuf/command_request_pb2.pyi +46 -69
  24. glide/protobuf/connection_request_pb2.py +13 -15
  25. glide/protobuf/connection_request_pb2.pyi +29 -57
  26. glide/protobuf/response_pb2.pyi +9 -8
  27. glide/protobuf_codec.py +6 -7
  28. glide/routes.py +8 -16
  29. {valkey_glide-1.3.5rc1.dist-info → valkey_glide-1.3.5rc3.dist-info}/METADATA +8 -10
  30. valkey_glide-1.3.5rc3.dist-info/RECORD +37 -0
  31. valkey_glide-1.3.5rc1.dist-info/RECORD +0 -37
  32. {valkey_glide-1.3.5rc1.dist-info → valkey_glide-1.3.5rc3.dist-info}/WHEEL +0 -0
glide/__init__.py CHANGED
@@ -1,12 +1,5 @@
1
1
  # Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
2
2
 
3
- from glide.async_commands.batch import (
4
- Batch,
5
- ClusterBatch,
6
- ClusterTransaction,
7
- TBatch,
8
- Transaction,
9
- )
10
3
  from glide.async_commands.bitmap import (
11
4
  BitEncoding,
12
5
  BitFieldGet,
@@ -113,6 +106,11 @@ from glide.async_commands.stream import (
113
106
  TrimByMaxLen,
114
107
  TrimByMinId,
115
108
  )
109
+ from glide.async_commands.transaction import (
110
+ ClusterTransaction,
111
+ Transaction,
112
+ TTransaction,
113
+ )
116
114
  from glide.config import (
117
115
  AdvancedGlideClientConfiguration,
118
116
  AdvancedGlideClusterClientConfiguration,
@@ -176,12 +174,10 @@ __all__ = [
176
174
  # Client
177
175
  "GlideClient",
178
176
  "GlideClusterClient",
179
- "Batch",
180
- "ClusterBatch",
181
- "ClusterTransaction",
182
177
  "Transaction",
178
+ "ClusterTransaction",
183
179
  "TGlideClient",
184
- "TBatch",
180
+ "TTransaction",
185
181
  # Config
186
182
  "AdvancedGlideClientConfiguration",
187
183
  "AdvancedGlideClusterClientConfiguration",
@@ -23,27 +23,26 @@ class BitmapIndexType(Enum):
23
23
 
24
24
 
25
25
  class OffsetOptions:
26
- """
27
- Represents offsets specifying a string interval to analyze in the `BITCOUNT` command. The offsets are
28
- zero-based indexes, with `0` being the first index of the string, `1` being the next index and so on.
29
- The offsets can also be negative numbers indicating offsets starting at the end of the string, with `-1` being
30
- the last index of the string, `-2` being the penultimate, and so on.
31
-
32
- Attributes:
33
- start (int): The starting offset index.
34
- end (Optional[int]): The ending offset index. Optional since Valkey version 8.0.0 and above for the BITCOUNT
35
- command. If not provided, it will default to the end of the string.
36
- index_type (Optional[BitmapIndexType]): The index offset type. This option can only be specified if you are
37
- using Valkey version 7.0.0 or above. Could be either `BitmapIndexType.BYTE` or `BitmapIndexType.BIT`.
38
- If no index type is provided, the indexes will be assumed to be byte indexes.
39
- """
40
-
41
26
  def __init__(
42
27
  self,
43
28
  start: int,
44
29
  end: Optional[int] = None,
45
30
  index_type: Optional[BitmapIndexType] = None,
46
31
  ):
32
+ """
33
+ Represents offsets specifying a string interval to analyze in the `BITCOUNT` command. The offsets are
34
+ zero-based indexes, with `0` being the first index of the string, `1` being the next index and so on.
35
+ The offsets can also be negative numbers indicating offsets starting at the end of the string, with `-1` being
36
+ the last index of the string, `-2` being the penultimate, and so on.
37
+
38
+ Args:
39
+ start (int): The starting offset index.
40
+ end (Optional[int]): The ending offset index. Optional since Valkey version 8.0.0 and above for the BITCOUNT
41
+ command. If not provided, it will default to the end of the string.
42
+ index_type (Optional[BitmapIndexType]): The index offset type. This option can only be specified if you are
43
+ using Valkey version 7.0.0 or above. Could be either `BitmapIndexType.BYTE` or `BitmapIndexType.BIT`.
44
+ If no index type is provided, the indexes will be assumed to be byte indexes.
45
+ """
47
46
  self.start = start
48
47
  self.end = end
49
48
  self.index_type = index_type
@@ -86,17 +85,16 @@ class BitEncoding(ABC):
86
85
 
87
86
 
88
87
  class SignedEncoding(BitEncoding):
89
- """
90
- Represents a signed argument encoding. Must be less than 65 bits long.
91
-
92
- Attributes:
93
- encoding_length (int): The bit size of the encoding.
94
- """
95
-
96
- #: Prefix specifying that the encoding is signed.
88
+ # Prefix specifying that the encoding is signed.
97
89
  SIGNED_ENCODING_PREFIX = "i"
98
90
 
99
91
  def __init__(self, encoding_length: int):
92
+ """
93
+ Represents a signed argument encoding. Must be less than 65 bits long.
94
+
95
+ Args:
96
+ encoding_length (int): The bit size of the encoding.
97
+ """
100
98
  self._encoding = f"{self.SIGNED_ENCODING_PREFIX}{str(encoding_length)}"
101
99
 
102
100
  def to_arg(self) -> str:
@@ -104,17 +102,16 @@ class SignedEncoding(BitEncoding):
104
102
 
105
103
 
106
104
  class UnsignedEncoding(BitEncoding):
107
- """
108
- Represents an unsigned argument encoding. Must be less than 64 bits long.
109
-
110
- Attributes:
111
- encoding_length (int): The bit size of the encoding.
112
- """
113
-
114
- #: Prefix specifying that the encoding is unsigned.
105
+ # Prefix specifying that the encoding is unsigned.
115
106
  UNSIGNED_ENCODING_PREFIX = "u"
116
107
 
117
108
  def __init__(self, encoding_length: int):
109
+ """
110
+ Represents an unsigned argument encoding. Must be less than 64 bits long.
111
+
112
+ Args:
113
+ encoding_length (int): The bit size of the encoding.
114
+ """
118
115
  self._encoding = f"{self.UNSIGNED_ENCODING_PREFIX}{str(encoding_length)}"
119
116
 
120
117
  def to_arg(self) -> str:
@@ -134,18 +131,17 @@ class BitFieldOffset(ABC):
134
131
 
135
132
 
136
133
  class BitOffset(BitFieldOffset):
137
- """
138
- Represents an offset in an array of bits for the `BITFIELD` or `BITFIELD_RO` commands. Must be greater than or
139
- equal to 0.
140
-
141
- For example, if we have the binary `01101001` with offset of 1 for an unsigned encoding of size 4, then the value
142
- is 13 from `0(1101)001`.
134
+ def __init__(self, offset: int):
135
+ """
136
+ Represents an offset in an array of bits for the `BITFIELD` or `BITFIELD_RO` commands. Must be greater than or
137
+ equal to 0.
143
138
 
144
- Attributes:
145
- offset (int): The bit index offset in the array of bits.
146
- """
139
+ For example, if we have the binary `01101001` with offset of 1 for an unsigned encoding of size 4, then the value
140
+ is 13 from `0(1101)001`.
147
141
 
148
- def __init__(self, offset: int):
142
+ Args:
143
+ offset (int): The bit index offset in the array of bits.
144
+ """
149
145
  self._offset = str(offset)
150
146
 
151
147
  def to_arg(self) -> str:
@@ -153,23 +149,22 @@ class BitOffset(BitFieldOffset):
153
149
 
154
150
 
155
151
  class BitOffsetMultiplier(BitFieldOffset):
156
- """
157
- Represents an offset in an array of bits for the `BITFIELD` or `BITFIELD_RO` commands. The bit offset index is
158
- calculated as the numerical value of the offset multiplied by the encoding value. Must be greater than or equal
159
- to 0.
160
-
161
- For example, if we have the binary 01101001 with offset multiplier of 1 for an unsigned encoding of size 4, then
162
- the value is 9 from `0110(1001)`.
163
-
164
- Attributes:
165
- offset (int): The offset in the array of bits, which will be multiplied by the encoding value to get the
166
- final bit index offset.
167
- """
168
-
169
- #: Prefix specifying that the offset uses an encoding multiplier.
152
+ # Prefix specifying that the offset uses an encoding multiplier.
170
153
  OFFSET_MULTIPLIER_PREFIX = "#"
171
154
 
172
155
  def __init__(self, offset: int):
156
+ """
157
+ Represents an offset in an array of bits for the `BITFIELD` or `BITFIELD_RO` commands. The bit offset index is
158
+ calculated as the numerical value of the offset multiplied by the encoding value. Must be greater than or equal
159
+ to 0.
160
+
161
+ For example, if we have the binary 01101001 with offset multiplier of 1 for an unsigned encoding of size 4, then
162
+ the value is 9 from `0110(1001)`.
163
+
164
+ Args:
165
+ offset (int): The offset in the array of bits, which will be multiplied by the encoding value to get the
166
+ final bit index offset.
167
+ """
173
168
  self._offset = f"{self.OFFSET_MULTIPLIER_PREFIX}{str(offset)}"
174
169
 
175
170
  def to_arg(self) -> str:
@@ -188,18 +183,17 @@ class BitFieldSubCommands(ABC):
188
183
 
189
184
 
190
185
  class BitFieldGet(BitFieldSubCommands):
191
- """
192
- Represents the "GET" subcommand for getting a value in the binary representation of the string stored in `key`.
193
-
194
- Attributes:
195
- encoding (BitEncoding): The bit encoding for the subcommand.
196
- offset (BitFieldOffset): The offset in the array of bits from which to get the value.
197
- """
198
-
199
- #: "GET" subcommand string for use in the `BITFIELD` or `BITFIELD_RO` commands.
186
+ # "GET" subcommand string for use in the `BITFIELD` or `BITFIELD_RO` commands.
200
187
  GET_COMMAND_STRING = "GET"
201
188
 
202
189
  def __init__(self, encoding: BitEncoding, offset: BitFieldOffset):
190
+ """
191
+ Represents the "GET" subcommand for getting a value in the binary representation of the string stored in `key`.
192
+
193
+ Args:
194
+ encoding (BitEncoding): The bit encoding for the subcommand.
195
+ offset (BitFieldOffset): The offset in the array of bits from which to get the value.
196
+ """
203
197
  self._encoding = encoding
204
198
  self._offset = offset
205
199
 
@@ -208,19 +202,18 @@ class BitFieldGet(BitFieldSubCommands):
208
202
 
209
203
 
210
204
  class BitFieldSet(BitFieldSubCommands):
211
- """
212
- Represents the "SET" subcommand for setting bits in the binary representation of the string stored in `key`.
213
-
214
- Args:
215
- encoding (BitEncoding): The bit encoding for the subcommand.
216
- offset (BitOffset): The offset in the array of bits where the value will be set.
217
- value (int): The value to set the bits in the binary value to.
218
- """
219
-
220
- #: "SET" subcommand string for use in the `BITFIELD` command.
205
+ # "SET" subcommand string for use in the `BITFIELD` command.
221
206
  SET_COMMAND_STRING = "SET"
222
207
 
223
208
  def __init__(self, encoding: BitEncoding, offset: BitFieldOffset, value: int):
209
+ """
210
+ Represents the "SET" subcommand for setting bits in the binary representation of the string stored in `key`.
211
+
212
+ Args:
213
+ encoding (BitEncoding): The bit encoding for the subcommand.
214
+ offset (BitOffset): The offset in the array of bits where the value will be set.
215
+ value (int): The value to set the bits in the binary value to.
216
+ """
224
217
  self._encoding = encoding
225
218
  self._offset = offset
226
219
  self._value = value
@@ -235,20 +228,19 @@ class BitFieldSet(BitFieldSubCommands):
235
228
 
236
229
 
237
230
  class BitFieldIncrBy(BitFieldSubCommands):
238
- """
239
- Represents the "INCRBY" subcommand for increasing or decreasing bits in the binary representation of the
240
- string stored in `key`.
241
-
242
- Attributes:
243
- encoding (BitEncoding): The bit encoding for the subcommand.
244
- offset (BitOffset): The offset in the array of bits where the value will be incremented.
245
- increment (int): The value to increment the bits in the binary value by.
246
- """
247
-
248
- #: "INCRBY" subcommand string for use in the `BITFIELD` command.
231
+ # "INCRBY" subcommand string for use in the `BITFIELD` command.
249
232
  INCRBY_COMMAND_STRING = "INCRBY"
250
233
 
251
234
  def __init__(self, encoding: BitEncoding, offset: BitFieldOffset, increment: int):
235
+ """
236
+ Represents the "INCRBY" subcommand for increasing or decreasing bits in the binary representation of the
237
+ string stored in `key`.
238
+
239
+ Args:
240
+ encoding (BitEncoding): The bit encoding for the subcommand.
241
+ offset (BitOffset): The offset in the array of bits where the value will be incremented.
242
+ increment (int): The value to increment the bits in the binary value by.
243
+ """
252
244
  self._encoding = encoding
253
245
  self._offset = offset
254
246
  self._increment = increment
@@ -284,18 +276,17 @@ class BitOverflowControl(Enum):
284
276
 
285
277
 
286
278
  class BitFieldOverflow(BitFieldSubCommands):
287
- """
288
- Represents the "OVERFLOW" subcommand that determines the result of the "SET" or "INCRBY" `BITFIELD` subcommands
289
- when an underflow or overflow occurs.
290
-
291
- Attributes:
292
- overflow_control (BitOverflowControl): The desired overflow behavior.
293
- """
294
-
295
- #: "OVERFLOW" subcommand string for use in the `BITFIELD` command.
279
+ # "OVERFLOW" subcommand string for use in the `BITFIELD` command.
296
280
  OVERFLOW_COMMAND_STRING = "OVERFLOW"
297
281
 
298
282
  def __init__(self, overflow_control: BitOverflowControl):
283
+ """
284
+ Represents the "OVERFLOW" subcommand that determines the result of the "SET" or "INCRBY" `BITFIELD` subcommands
285
+ when an underflow or overflow occurs.
286
+
287
+ Args:
288
+ overflow_control (BitOverflowControl): The desired overflow behavior.
289
+ """
299
290
  self._overflow_control = overflow_control
300
291
 
301
292
  def to_args(self) -> List[str]: