valkey-glide 1.3.4rc1__cp313-cp313-macosx_11_0_arm64.whl → 2.0.0rc6__cp313-cp313-macosx_11_0_arm64.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 +11 -7
  2. glide/async_commands/{transaction.py → batch.py} +1413 -987
  3. glide/async_commands/bitmap.py +94 -85
  4. glide/async_commands/cluster_commands.py +308 -123
  5. glide/async_commands/command_args.py +7 -6
  6. glide/async_commands/core.py +1304 -714
  7. glide/async_commands/server_modules/ft.py +83 -14
  8. glide/async_commands/server_modules/ft_options/ft_aggregate_options.py +15 -8
  9. glide/async_commands/server_modules/ft_options/ft_create_options.py +23 -11
  10. glide/async_commands/server_modules/ft_options/ft_profile_options.py +12 -7
  11. glide/async_commands/server_modules/ft_options/ft_search_options.py +12 -6
  12. glide/async_commands/server_modules/glide_json.py +134 -43
  13. glide/async_commands/server_modules/json_batch.py +157 -127
  14. glide/async_commands/sorted_set.py +39 -29
  15. glide/async_commands/standalone_commands.py +199 -95
  16. glide/async_commands/stream.py +94 -87
  17. glide/config.py +165 -105
  18. glide/constants.py +8 -4
  19. glide/glide.cpython-313-darwin.so +0 -0
  20. glide/glide_client.py +273 -94
  21. glide/logger.py +1 -1
  22. glide/protobuf/command_request_pb2.py +15 -15
  23. glide/protobuf/command_request_pb2.pyi +69 -46
  24. glide/protobuf/connection_request_pb2.py +15 -13
  25. glide/protobuf/connection_request_pb2.pyi +57 -29
  26. glide/protobuf/response_pb2.pyi +8 -9
  27. glide/protobuf_codec.py +7 -6
  28. glide/routes.py +41 -8
  29. {valkey_glide-1.3.4rc1.dist-info → valkey_glide-2.0.0rc6.dist-info}/METADATA +29 -8
  30. valkey_glide-2.0.0rc6.dist-info/RECORD +37 -0
  31. valkey_glide-1.3.4rc1.dist-info/RECORD +0 -37
  32. {valkey_glide-1.3.4rc1.dist-info → valkey_glide-2.0.0rc6.dist-info}/WHEEL +0 -0
@@ -23,26 +23,27 @@ 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
+
26
41
  def __init__(
27
42
  self,
28
43
  start: int,
29
44
  end: Optional[int] = None,
30
45
  index_type: Optional[BitmapIndexType] = None,
31
46
  ):
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
- """
46
47
  self.start = start
47
48
  self.end = end
48
49
  self.index_type = index_type
@@ -85,16 +86,17 @@ class BitEncoding(ABC):
85
86
 
86
87
 
87
88
  class SignedEncoding(BitEncoding):
88
- # Prefix specifying that the encoding is signed.
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.
89
97
  SIGNED_ENCODING_PREFIX = "i"
90
98
 
91
99
  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
- """
98
100
  self._encoding = f"{self.SIGNED_ENCODING_PREFIX}{str(encoding_length)}"
99
101
 
100
102
  def to_arg(self) -> str:
@@ -102,16 +104,17 @@ class SignedEncoding(BitEncoding):
102
104
 
103
105
 
104
106
  class UnsignedEncoding(BitEncoding):
105
- # Prefix specifying that the encoding is unsigned.
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.
106
115
  UNSIGNED_ENCODING_PREFIX = "u"
107
116
 
108
117
  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
- """
115
118
  self._encoding = f"{self.UNSIGNED_ENCODING_PREFIX}{str(encoding_length)}"
116
119
 
117
120
  def to_arg(self) -> str:
@@ -131,17 +134,18 @@ class BitFieldOffset(ABC):
131
134
 
132
135
 
133
136
  class BitOffset(BitFieldOffset):
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.
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.
138
140
 
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`.
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`.
141
143
 
142
- Args:
143
- offset (int): The bit index offset in the array of bits.
144
- """
144
+ Attributes:
145
+ offset (int): The bit index offset in the array of bits.
146
+ """
147
+
148
+ def __init__(self, offset: int):
145
149
  self._offset = str(offset)
146
150
 
147
151
  def to_arg(self) -> str:
@@ -149,22 +153,23 @@ class BitOffset(BitFieldOffset):
149
153
 
150
154
 
151
155
  class BitOffsetMultiplier(BitFieldOffset):
152
- # Prefix specifying that the offset uses an encoding multiplier.
153
- OFFSET_MULTIPLIER_PREFIX = "#"
154
-
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.
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
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)`.
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
163
 
164
- Args:
165
- offset (int): The offset in the array of bits, which will be multiplied by the encoding value to get the
164
+ Attributes:
165
+ offset (int): The offset in the array of bits, which will be multiplied by the encoding value to get the
166
166
  final bit index offset.
167
- """
167
+ """
168
+
169
+ #: Prefix specifying that the offset uses an encoding multiplier.
170
+ OFFSET_MULTIPLIER_PREFIX = "#"
171
+
172
+ def __init__(self, offset: int):
168
173
  self._offset = f"{self.OFFSET_MULTIPLIER_PREFIX}{str(offset)}"
169
174
 
170
175
  def to_arg(self) -> str:
@@ -183,17 +188,18 @@ class BitFieldSubCommands(ABC):
183
188
 
184
189
 
185
190
  class BitFieldGet(BitFieldSubCommands):
186
- # "GET" subcommand string for use in the `BITFIELD` or `BITFIELD_RO` commands.
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.
187
200
  GET_COMMAND_STRING = "GET"
188
201
 
189
202
  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
- """
197
203
  self._encoding = encoding
198
204
  self._offset = offset
199
205
 
@@ -202,18 +208,19 @@ class BitFieldGet(BitFieldSubCommands):
202
208
 
203
209
 
204
210
  class BitFieldSet(BitFieldSubCommands):
205
- # "SET" subcommand string for use in the `BITFIELD` command.
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.
206
221
  SET_COMMAND_STRING = "SET"
207
222
 
208
223
  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
- """
217
224
  self._encoding = encoding
218
225
  self._offset = offset
219
226
  self._value = value
@@ -228,19 +235,20 @@ class BitFieldSet(BitFieldSubCommands):
228
235
 
229
236
 
230
237
  class BitFieldIncrBy(BitFieldSubCommands):
231
- # "INCRBY" subcommand string for use in the `BITFIELD` command.
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.
232
249
  INCRBY_COMMAND_STRING = "INCRBY"
233
250
 
234
251
  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
- """
244
252
  self._encoding = encoding
245
253
  self._offset = offset
246
254
  self._increment = increment
@@ -276,17 +284,18 @@ class BitOverflowControl(Enum):
276
284
 
277
285
 
278
286
  class BitFieldOverflow(BitFieldSubCommands):
279
- # "OVERFLOW" subcommand string for use in the `BITFIELD` command.
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.
280
296
  OVERFLOW_COMMAND_STRING = "OVERFLOW"
281
297
 
282
298
  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
- """
290
299
  self._overflow_control = overflow_control
291
300
 
292
301
  def to_args(self) -> List[str]: