valkey-glide 1.2.0rc14__cp311-cp311-macosx_11_0_arm64.whl → 2.2.3__cp311-cp311-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.
Files changed (47) hide show
  1. glide/__init__.py +169 -104
  2. glide/async_commands/cluster_commands.py +367 -172
  3. glide/async_commands/core.py +1808 -1026
  4. glide/async_commands/{server_modules/ft.py → ft.py} +91 -21
  5. glide/async_commands/{server_modules/glide_json.py → glide_json.py} +161 -146
  6. glide/async_commands/standalone_commands.py +204 -136
  7. glide/glide.cpython-311-darwin.so +0 -0
  8. glide/glide.pyi +26 -1
  9. glide/glide_client.py +355 -136
  10. glide/logger.py +34 -22
  11. glide/opentelemetry.py +185 -0
  12. glide_shared/__init__.py +330 -0
  13. glide_shared/commands/__init__.py +0 -0
  14. glide/async_commands/transaction.py → glide_shared/commands/batch.py +1845 -1059
  15. glide_shared/commands/batch_options.py +261 -0
  16. {glide/async_commands → glide_shared/commands}/bitmap.py +96 -86
  17. {glide/async_commands → glide_shared/commands}/command_args.py +7 -6
  18. glide_shared/commands/core_options.py +407 -0
  19. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_aggregate_options.py +18 -11
  20. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_create_options.py +27 -13
  21. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_profile_options.py +16 -11
  22. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_search_options.py +17 -9
  23. glide_shared/commands/server_modules/json_batch.py +820 -0
  24. glide_shared/commands/server_modules/json_options.py +93 -0
  25. {glide/async_commands → glide_shared/commands}/sorted_set.py +42 -32
  26. {glide/async_commands → glide_shared/commands}/stream.py +95 -88
  27. glide_shared/config.py +975 -0
  28. {glide → glide_shared}/constants.py +11 -7
  29. {glide → glide_shared}/exceptions.py +27 -1
  30. glide_shared/protobuf/command_request_pb2.py +56 -0
  31. glide_shared/protobuf/connection_request_pb2.py +56 -0
  32. {glide → glide_shared}/protobuf/response_pb2.py +6 -6
  33. {glide → glide_shared}/protobuf_codec.py +7 -6
  34. glide_shared/routes.py +161 -0
  35. valkey_glide-2.2.3.dist-info/METADATA +211 -0
  36. valkey_glide-2.2.3.dist-info/RECORD +40 -0
  37. {valkey_glide-1.2.0rc14.dist-info → valkey_glide-2.2.3.dist-info}/WHEEL +1 -1
  38. glide/config.py +0 -521
  39. glide/protobuf/command_request_pb2.py +0 -54
  40. glide/protobuf/command_request_pb2.pyi +0 -1161
  41. glide/protobuf/connection_request_pb2.py +0 -52
  42. glide/protobuf/connection_request_pb2.pyi +0 -287
  43. glide/protobuf/response_pb2.pyi +0 -101
  44. glide/routes.py +0 -114
  45. valkey_glide-1.2.0rc14.dist-info/METADATA +0 -122
  46. valkey_glide-1.2.0rc14.dist-info/RECORD +0 -36
  47. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_constants.py +0 -0
@@ -1,52 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # source: protobuf/connection_request.proto
4
- # Protobuf Python Version: 4.25.1
5
- """Generated protocol buffer code."""
6
- from google.protobuf import descriptor as _descriptor
7
- from google.protobuf import descriptor_pool as _descriptor_pool
8
- from google.protobuf import symbol_database as _symbol_database
9
- from google.protobuf.internal import builder as _builder
10
- # @@protoc_insertion_point(imports)
11
-
12
- _sym_db = _symbol_database.Default()
13
-
14
-
15
-
16
-
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!protobuf/connection_request.proto\x12\x12\x63onnection_request\")\n\x0bNodeAddress\x12\x0c\n\x04host\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x01(\r\"8\n\x12\x41uthenticationInfo\x12\x10\n\x08password\x18\x01 \x01(\t\x12\x10\n\x08username\x18\x02 \x01(\t\"7\n\x1cPeriodicChecksManualInterval\x12\x17\n\x0f\x64uration_in_sec\x18\x01 \x01(\r\"\x18\n\x16PeriodicChecksDisabled\"8\n\x18PubSubChannelsOrPatterns\x12\x1c\n\x14\x63hannels_or_patterns\x18\x01 \x03(\x0c\"\xf1\x01\n\x13PubSubSubscriptions\x12k\n\x1c\x63hannels_or_patterns_by_type\x18\x01 \x03(\x0b\x32\x45.connection_request.PubSubSubscriptions.ChannelsOrPatternsByTypeEntry\x1am\n\x1d\x43hannelsOrPatternsByTypeEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.connection_request.PubSubChannelsOrPatterns:\x02\x38\x01\"\x8f\x06\n\x11\x43onnectionRequest\x12\x32\n\taddresses\x18\x01 \x03(\x0b\x32\x1f.connection_request.NodeAddress\x12-\n\x08tls_mode\x18\x02 \x01(\x0e\x32\x1b.connection_request.TlsMode\x12\x1c\n\x14\x63luster_mode_enabled\x18\x03 \x01(\x08\x12\x17\n\x0frequest_timeout\x18\x04 \x01(\r\x12/\n\tread_from\x18\x05 \x01(\x0e\x32\x1c.connection_request.ReadFrom\x12N\n\x19\x63onnection_retry_strategy\x18\x06 \x01(\x0b\x32+.connection_request.ConnectionRetryStrategy\x12\x43\n\x13\x61uthentication_info\x18\x07 \x01(\x0b\x32&.connection_request.AuthenticationInfo\x12\x13\n\x0b\x64\x61tabase_id\x18\x08 \x01(\r\x12\x35\n\x08protocol\x18\t \x01(\x0e\x32#.connection_request.ProtocolVersion\x12\x13\n\x0b\x63lient_name\x18\n \x01(\t\x12[\n\x1fperiodic_checks_manual_interval\x18\x0b \x01(\x0b\x32\x30.connection_request.PeriodicChecksManualIntervalH\x00\x12N\n\x18periodic_checks_disabled\x18\x0c \x01(\x0b\x32*.connection_request.PeriodicChecksDisabledH\x00\x12\x45\n\x14pubsub_subscriptions\x18\r \x01(\x0b\x32\'.connection_request.PubSubSubscriptions\x12\x1f\n\x17inflight_requests_limit\x18\x0e \x01(\r\x12\x11\n\tclient_az\x18\x0f \x01(\tB\x11\n\x0fperiodic_checks\"[\n\x17\x43onnectionRetryStrategy\x12\x19\n\x11number_of_retries\x18\x01 \x01(\r\x12\x0e\n\x06\x66\x61\x63tor\x18\x02 \x01(\r\x12\x15\n\rexponent_base\x18\x03 \x01(\r*M\n\x08ReadFrom\x12\x0b\n\x07Primary\x10\x00\x12\x11\n\rPreferReplica\x10\x01\x12\x11\n\rLowestLatency\x10\x02\x12\x0e\n\nAZAffinity\x10\x03*4\n\x07TlsMode\x12\t\n\x05NoTls\x10\x00\x12\r\n\tSecureTls\x10\x01\x12\x0f\n\x0bInsecureTls\x10\x02*\'\n\x0fProtocolVersion\x12\t\n\x05RESP3\x10\x00\x12\t\n\x05RESP2\x10\x01*8\n\x11PubSubChannelType\x12\t\n\x05\x45xact\x10\x00\x12\x0b\n\x07Pattern\x10\x01\x12\x0b\n\x07Sharded\x10\x02\x62\x06proto3')
18
-
19
- _globals = globals()
20
- _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
- _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protobuf.connection_request_pb2', _globals)
22
- if _descriptor._USE_C_DESCRIPTORS == False:
23
- DESCRIPTOR._options = None
24
- _globals['_PUBSUBSUBSCRIPTIONS_CHANNELSORPATTERNSBYTYPEENTRY']._options = None
25
- _globals['_PUBSUBSUBSCRIPTIONS_CHANNELSORPATTERNSBYTYPEENTRY']._serialized_options = b'8\001'
26
- _globals['_READFROM']._serialized_start=1422
27
- _globals['_READFROM']._serialized_end=1499
28
- _globals['_TLSMODE']._serialized_start=1501
29
- _globals['_TLSMODE']._serialized_end=1553
30
- _globals['_PROTOCOLVERSION']._serialized_start=1555
31
- _globals['_PROTOCOLVERSION']._serialized_end=1594
32
- _globals['_PUBSUBCHANNELTYPE']._serialized_start=1596
33
- _globals['_PUBSUBCHANNELTYPE']._serialized_end=1652
34
- _globals['_NODEADDRESS']._serialized_start=57
35
- _globals['_NODEADDRESS']._serialized_end=98
36
- _globals['_AUTHENTICATIONINFO']._serialized_start=100
37
- _globals['_AUTHENTICATIONINFO']._serialized_end=156
38
- _globals['_PERIODICCHECKSMANUALINTERVAL']._serialized_start=158
39
- _globals['_PERIODICCHECKSMANUALINTERVAL']._serialized_end=213
40
- _globals['_PERIODICCHECKSDISABLED']._serialized_start=215
41
- _globals['_PERIODICCHECKSDISABLED']._serialized_end=239
42
- _globals['_PUBSUBCHANNELSORPATTERNS']._serialized_start=241
43
- _globals['_PUBSUBCHANNELSORPATTERNS']._serialized_end=297
44
- _globals['_PUBSUBSUBSCRIPTIONS']._serialized_start=300
45
- _globals['_PUBSUBSUBSCRIPTIONS']._serialized_end=541
46
- _globals['_PUBSUBSUBSCRIPTIONS_CHANNELSORPATTERNSBYTYPEENTRY']._serialized_start=432
47
- _globals['_PUBSUBSUBSCRIPTIONS_CHANNELSORPATTERNSBYTYPEENTRY']._serialized_end=541
48
- _globals['_CONNECTIONREQUEST']._serialized_start=544
49
- _globals['_CONNECTIONREQUEST']._serialized_end=1327
50
- _globals['_CONNECTIONRETRYSTRATEGY']._serialized_start=1329
51
- _globals['_CONNECTIONRETRYSTRATEGY']._serialized_end=1420
52
- # @@protoc_insertion_point(module_scope)
@@ -1,287 +0,0 @@
1
- """
2
- @generated by mypy-protobuf. Do not edit manually!
3
- isort:skip_file
4
- """
5
-
6
- import builtins
7
- import collections.abc
8
- import google.protobuf.descriptor
9
- import google.protobuf.internal.containers
10
- import google.protobuf.internal.enum_type_wrapper
11
- import google.protobuf.message
12
- import sys
13
- import typing
14
-
15
- if sys.version_info >= (3, 10):
16
- import typing as typing_extensions
17
- else:
18
- import typing_extensions
19
-
20
- DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
21
-
22
- class _ReadFrom:
23
- ValueType = typing.NewType("ValueType", builtins.int)
24
- V: typing_extensions.TypeAlias = ValueType
25
-
26
- class _ReadFromEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ReadFrom.ValueType], builtins.type):
27
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
28
- Primary: _ReadFrom.ValueType # 0
29
- PreferReplica: _ReadFrom.ValueType # 1
30
- LowestLatency: _ReadFrom.ValueType # 2
31
- AZAffinity: _ReadFrom.ValueType # 3
32
-
33
- class ReadFrom(_ReadFrom, metaclass=_ReadFromEnumTypeWrapper): ...
34
-
35
- Primary: ReadFrom.ValueType # 0
36
- PreferReplica: ReadFrom.ValueType # 1
37
- LowestLatency: ReadFrom.ValueType # 2
38
- AZAffinity: ReadFrom.ValueType # 3
39
- global___ReadFrom = ReadFrom
40
-
41
- class _TlsMode:
42
- ValueType = typing.NewType("ValueType", builtins.int)
43
- V: typing_extensions.TypeAlias = ValueType
44
-
45
- class _TlsModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TlsMode.ValueType], builtins.type):
46
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
47
- NoTls: _TlsMode.ValueType # 0
48
- SecureTls: _TlsMode.ValueType # 1
49
- InsecureTls: _TlsMode.ValueType # 2
50
-
51
- class TlsMode(_TlsMode, metaclass=_TlsModeEnumTypeWrapper): ...
52
-
53
- NoTls: TlsMode.ValueType # 0
54
- SecureTls: TlsMode.ValueType # 1
55
- InsecureTls: TlsMode.ValueType # 2
56
- global___TlsMode = TlsMode
57
-
58
- class _ProtocolVersion:
59
- ValueType = typing.NewType("ValueType", builtins.int)
60
- V: typing_extensions.TypeAlias = ValueType
61
-
62
- class _ProtocolVersionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ProtocolVersion.ValueType], builtins.type):
63
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
64
- RESP3: _ProtocolVersion.ValueType # 0
65
- RESP2: _ProtocolVersion.ValueType # 1
66
-
67
- class ProtocolVersion(_ProtocolVersion, metaclass=_ProtocolVersionEnumTypeWrapper): ...
68
-
69
- RESP3: ProtocolVersion.ValueType # 0
70
- RESP2: ProtocolVersion.ValueType # 1
71
- global___ProtocolVersion = ProtocolVersion
72
-
73
- class _PubSubChannelType:
74
- ValueType = typing.NewType("ValueType", builtins.int)
75
- V: typing_extensions.TypeAlias = ValueType
76
-
77
- class _PubSubChannelTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PubSubChannelType.ValueType], builtins.type):
78
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
79
- Exact: _PubSubChannelType.ValueType # 0
80
- Pattern: _PubSubChannelType.ValueType # 1
81
- Sharded: _PubSubChannelType.ValueType # 2
82
-
83
- class PubSubChannelType(_PubSubChannelType, metaclass=_PubSubChannelTypeEnumTypeWrapper): ...
84
-
85
- Exact: PubSubChannelType.ValueType # 0
86
- Pattern: PubSubChannelType.ValueType # 1
87
- Sharded: PubSubChannelType.ValueType # 2
88
- global___PubSubChannelType = PubSubChannelType
89
-
90
- @typing.final
91
- class NodeAddress(google.protobuf.message.Message):
92
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
93
-
94
- HOST_FIELD_NUMBER: builtins.int
95
- PORT_FIELD_NUMBER: builtins.int
96
- host: builtins.str
97
- port: builtins.int
98
- def __init__(
99
- self,
100
- *,
101
- host: builtins.str = ...,
102
- port: builtins.int = ...,
103
- ) -> None: ...
104
- def ClearField(self, field_name: typing.Literal["host", b"host", "port", b"port"]) -> None: ...
105
-
106
- global___NodeAddress = NodeAddress
107
-
108
- @typing.final
109
- class AuthenticationInfo(google.protobuf.message.Message):
110
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
111
-
112
- PASSWORD_FIELD_NUMBER: builtins.int
113
- USERNAME_FIELD_NUMBER: builtins.int
114
- password: builtins.str
115
- username: builtins.str
116
- def __init__(
117
- self,
118
- *,
119
- password: builtins.str = ...,
120
- username: builtins.str = ...,
121
- ) -> None: ...
122
- def ClearField(self, field_name: typing.Literal["password", b"password", "username", b"username"]) -> None: ...
123
-
124
- global___AuthenticationInfo = AuthenticationInfo
125
-
126
- @typing.final
127
- class PeriodicChecksManualInterval(google.protobuf.message.Message):
128
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
129
-
130
- DURATION_IN_SEC_FIELD_NUMBER: builtins.int
131
- duration_in_sec: builtins.int
132
- def __init__(
133
- self,
134
- *,
135
- duration_in_sec: builtins.int = ...,
136
- ) -> None: ...
137
- def ClearField(self, field_name: typing.Literal["duration_in_sec", b"duration_in_sec"]) -> None: ...
138
-
139
- global___PeriodicChecksManualInterval = PeriodicChecksManualInterval
140
-
141
- @typing.final
142
- class PeriodicChecksDisabled(google.protobuf.message.Message):
143
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
144
-
145
- def __init__(
146
- self,
147
- ) -> None: ...
148
-
149
- global___PeriodicChecksDisabled = PeriodicChecksDisabled
150
-
151
- @typing.final
152
- class PubSubChannelsOrPatterns(google.protobuf.message.Message):
153
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
154
-
155
- CHANNELS_OR_PATTERNS_FIELD_NUMBER: builtins.int
156
- @property
157
- def channels_or_patterns(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]: ...
158
- def __init__(
159
- self,
160
- *,
161
- channels_or_patterns: collections.abc.Iterable[builtins.bytes] | None = ...,
162
- ) -> None: ...
163
- def ClearField(self, field_name: typing.Literal["channels_or_patterns", b"channels_or_patterns"]) -> None: ...
164
-
165
- global___PubSubChannelsOrPatterns = PubSubChannelsOrPatterns
166
-
167
- @typing.final
168
- class PubSubSubscriptions(google.protobuf.message.Message):
169
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
170
-
171
- @typing.final
172
- class ChannelsOrPatternsByTypeEntry(google.protobuf.message.Message):
173
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
174
-
175
- KEY_FIELD_NUMBER: builtins.int
176
- VALUE_FIELD_NUMBER: builtins.int
177
- key: builtins.int
178
- @property
179
- def value(self) -> global___PubSubChannelsOrPatterns: ...
180
- def __init__(
181
- self,
182
- *,
183
- key: builtins.int = ...,
184
- value: global___PubSubChannelsOrPatterns | None = ...,
185
- ) -> None: ...
186
- def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ...
187
- def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ...
188
-
189
- CHANNELS_OR_PATTERNS_BY_TYPE_FIELD_NUMBER: builtins.int
190
- @property
191
- def channels_or_patterns_by_type(self) -> google.protobuf.internal.containers.MessageMap[builtins.int, global___PubSubChannelsOrPatterns]: ...
192
- def __init__(
193
- self,
194
- *,
195
- channels_or_patterns_by_type: collections.abc.Mapping[builtins.int, global___PubSubChannelsOrPatterns] | None = ...,
196
- ) -> None: ...
197
- def ClearField(self, field_name: typing.Literal["channels_or_patterns_by_type", b"channels_or_patterns_by_type"]) -> None: ...
198
-
199
- global___PubSubSubscriptions = PubSubSubscriptions
200
-
201
- @typing.final
202
- class ConnectionRequest(google.protobuf.message.Message):
203
- """IMPORTANT - if you add fields here, you probably need to add them also in client/mod.rs:`sanitized_request_string`."""
204
-
205
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
206
-
207
- ADDRESSES_FIELD_NUMBER: builtins.int
208
- TLS_MODE_FIELD_NUMBER: builtins.int
209
- CLUSTER_MODE_ENABLED_FIELD_NUMBER: builtins.int
210
- REQUEST_TIMEOUT_FIELD_NUMBER: builtins.int
211
- READ_FROM_FIELD_NUMBER: builtins.int
212
- CONNECTION_RETRY_STRATEGY_FIELD_NUMBER: builtins.int
213
- AUTHENTICATION_INFO_FIELD_NUMBER: builtins.int
214
- DATABASE_ID_FIELD_NUMBER: builtins.int
215
- PROTOCOL_FIELD_NUMBER: builtins.int
216
- CLIENT_NAME_FIELD_NUMBER: builtins.int
217
- PERIODIC_CHECKS_MANUAL_INTERVAL_FIELD_NUMBER: builtins.int
218
- PERIODIC_CHECKS_DISABLED_FIELD_NUMBER: builtins.int
219
- PUBSUB_SUBSCRIPTIONS_FIELD_NUMBER: builtins.int
220
- INFLIGHT_REQUESTS_LIMIT_FIELD_NUMBER: builtins.int
221
- CLIENT_AZ_FIELD_NUMBER: builtins.int
222
- tls_mode: global___TlsMode.ValueType
223
- cluster_mode_enabled: builtins.bool
224
- request_timeout: builtins.int
225
- read_from: global___ReadFrom.ValueType
226
- database_id: builtins.int
227
- protocol: global___ProtocolVersion.ValueType
228
- client_name: builtins.str
229
- inflight_requests_limit: builtins.int
230
- client_az: builtins.str
231
- @property
232
- def addresses(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___NodeAddress]: ...
233
- @property
234
- def connection_retry_strategy(self) -> global___ConnectionRetryStrategy: ...
235
- @property
236
- def authentication_info(self) -> global___AuthenticationInfo: ...
237
- @property
238
- def periodic_checks_manual_interval(self) -> global___PeriodicChecksManualInterval: ...
239
- @property
240
- def periodic_checks_disabled(self) -> global___PeriodicChecksDisabled: ...
241
- @property
242
- def pubsub_subscriptions(self) -> global___PubSubSubscriptions: ...
243
- def __init__(
244
- self,
245
- *,
246
- addresses: collections.abc.Iterable[global___NodeAddress] | None = ...,
247
- tls_mode: global___TlsMode.ValueType = ...,
248
- cluster_mode_enabled: builtins.bool = ...,
249
- request_timeout: builtins.int = ...,
250
- read_from: global___ReadFrom.ValueType = ...,
251
- connection_retry_strategy: global___ConnectionRetryStrategy | None = ...,
252
- authentication_info: global___AuthenticationInfo | None = ...,
253
- database_id: builtins.int = ...,
254
- protocol: global___ProtocolVersion.ValueType = ...,
255
- client_name: builtins.str = ...,
256
- periodic_checks_manual_interval: global___PeriodicChecksManualInterval | None = ...,
257
- periodic_checks_disabled: global___PeriodicChecksDisabled | None = ...,
258
- pubsub_subscriptions: global___PubSubSubscriptions | None = ...,
259
- inflight_requests_limit: builtins.int = ...,
260
- client_az: builtins.str = ...,
261
- ) -> None: ...
262
- def HasField(self, field_name: typing.Literal["authentication_info", b"authentication_info", "connection_retry_strategy", b"connection_retry_strategy", "periodic_checks", b"periodic_checks", "periodic_checks_disabled", b"periodic_checks_disabled", "periodic_checks_manual_interval", b"periodic_checks_manual_interval", "pubsub_subscriptions", b"pubsub_subscriptions"]) -> builtins.bool: ...
263
- def ClearField(self, field_name: typing.Literal["addresses", b"addresses", "authentication_info", b"authentication_info", "client_az", b"client_az", "client_name", b"client_name", "cluster_mode_enabled", b"cluster_mode_enabled", "connection_retry_strategy", b"connection_retry_strategy", "database_id", b"database_id", "inflight_requests_limit", b"inflight_requests_limit", "periodic_checks", b"periodic_checks", "periodic_checks_disabled", b"periodic_checks_disabled", "periodic_checks_manual_interval", b"periodic_checks_manual_interval", "protocol", b"protocol", "pubsub_subscriptions", b"pubsub_subscriptions", "read_from", b"read_from", "request_timeout", b"request_timeout", "tls_mode", b"tls_mode"]) -> None: ...
264
- def WhichOneof(self, oneof_group: typing.Literal["periodic_checks", b"periodic_checks"]) -> typing.Literal["periodic_checks_manual_interval", "periodic_checks_disabled"] | None: ...
265
-
266
- global___ConnectionRequest = ConnectionRequest
267
-
268
- @typing.final
269
- class ConnectionRetryStrategy(google.protobuf.message.Message):
270
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
271
-
272
- NUMBER_OF_RETRIES_FIELD_NUMBER: builtins.int
273
- FACTOR_FIELD_NUMBER: builtins.int
274
- EXPONENT_BASE_FIELD_NUMBER: builtins.int
275
- number_of_retries: builtins.int
276
- factor: builtins.int
277
- exponent_base: builtins.int
278
- def __init__(
279
- self,
280
- *,
281
- number_of_retries: builtins.int = ...,
282
- factor: builtins.int = ...,
283
- exponent_base: builtins.int = ...,
284
- ) -> None: ...
285
- def ClearField(self, field_name: typing.Literal["exponent_base", b"exponent_base", "factor", b"factor", "number_of_retries", b"number_of_retries"]) -> None: ...
286
-
287
- global___ConnectionRetryStrategy = ConnectionRetryStrategy
@@ -1,101 +0,0 @@
1
- """
2
- @generated by mypy-protobuf. Do not edit manually!
3
- isort:skip_file
4
- """
5
-
6
- import builtins
7
- import google.protobuf.descriptor
8
- import google.protobuf.internal.enum_type_wrapper
9
- import google.protobuf.message
10
- import sys
11
- import typing
12
-
13
- if sys.version_info >= (3, 10):
14
- import typing as typing_extensions
15
- else:
16
- import typing_extensions
17
-
18
- DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
19
-
20
- class _RequestErrorType:
21
- ValueType = typing.NewType("ValueType", builtins.int)
22
- V: typing_extensions.TypeAlias = ValueType
23
-
24
- class _RequestErrorTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_RequestErrorType.ValueType], builtins.type):
25
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
26
- Unspecified: _RequestErrorType.ValueType # 0
27
- ExecAbort: _RequestErrorType.ValueType # 1
28
- Timeout: _RequestErrorType.ValueType # 2
29
- Disconnect: _RequestErrorType.ValueType # 3
30
-
31
- class RequestErrorType(_RequestErrorType, metaclass=_RequestErrorTypeEnumTypeWrapper): ...
32
-
33
- Unspecified: RequestErrorType.ValueType # 0
34
- ExecAbort: RequestErrorType.ValueType # 1
35
- Timeout: RequestErrorType.ValueType # 2
36
- Disconnect: RequestErrorType.ValueType # 3
37
- global___RequestErrorType = RequestErrorType
38
-
39
- class _ConstantResponse:
40
- ValueType = typing.NewType("ValueType", builtins.int)
41
- V: typing_extensions.TypeAlias = ValueType
42
-
43
- class _ConstantResponseEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ConstantResponse.ValueType], builtins.type):
44
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
45
- OK: _ConstantResponse.ValueType # 0
46
-
47
- class ConstantResponse(_ConstantResponse, metaclass=_ConstantResponseEnumTypeWrapper): ...
48
-
49
- OK: ConstantResponse.ValueType # 0
50
- global___ConstantResponse = ConstantResponse
51
-
52
- @typing.final
53
- class RequestError(google.protobuf.message.Message):
54
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
55
-
56
- TYPE_FIELD_NUMBER: builtins.int
57
- MESSAGE_FIELD_NUMBER: builtins.int
58
- type: global___RequestErrorType.ValueType
59
- message: builtins.str
60
- def __init__(
61
- self,
62
- *,
63
- type: global___RequestErrorType.ValueType = ...,
64
- message: builtins.str = ...,
65
- ) -> None: ...
66
- def ClearField(self, field_name: typing.Literal["message", b"message", "type", b"type"]) -> None: ...
67
-
68
- global___RequestError = RequestError
69
-
70
- @typing.final
71
- class Response(google.protobuf.message.Message):
72
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
73
-
74
- CALLBACK_IDX_FIELD_NUMBER: builtins.int
75
- RESP_POINTER_FIELD_NUMBER: builtins.int
76
- CONSTANT_RESPONSE_FIELD_NUMBER: builtins.int
77
- REQUEST_ERROR_FIELD_NUMBER: builtins.int
78
- CLOSING_ERROR_FIELD_NUMBER: builtins.int
79
- IS_PUSH_FIELD_NUMBER: builtins.int
80
- callback_idx: builtins.int
81
- resp_pointer: builtins.int
82
- constant_response: global___ConstantResponse.ValueType
83
- closing_error: builtins.str
84
- is_push: builtins.bool
85
- @property
86
- def request_error(self) -> global___RequestError: ...
87
- def __init__(
88
- self,
89
- *,
90
- callback_idx: builtins.int = ...,
91
- resp_pointer: builtins.int = ...,
92
- constant_response: global___ConstantResponse.ValueType = ...,
93
- request_error: global___RequestError | None = ...,
94
- closing_error: builtins.str = ...,
95
- is_push: builtins.bool = ...,
96
- ) -> None: ...
97
- def HasField(self, field_name: typing.Literal["closing_error", b"closing_error", "constant_response", b"constant_response", "request_error", b"request_error", "resp_pointer", b"resp_pointer", "value", b"value"]) -> builtins.bool: ...
98
- def ClearField(self, field_name: typing.Literal["callback_idx", b"callback_idx", "closing_error", b"closing_error", "constant_response", b"constant_response", "is_push", b"is_push", "request_error", b"request_error", "resp_pointer", b"resp_pointer", "value", b"value"]) -> None: ...
99
- def WhichOneof(self, oneof_group: typing.Literal["value", b"value"]) -> typing.Literal["resp_pointer", "constant_response", "request_error", "closing_error"] | None: ...
100
-
101
- global___Response = Response
glide/routes.py DELETED
@@ -1,114 +0,0 @@
1
- # Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
2
-
3
- from enum import Enum
4
- from typing import Optional
5
-
6
- from glide.exceptions import RequestError
7
- from glide.protobuf.command_request_pb2 import CommandRequest, SimpleRoutes
8
- from glide.protobuf.command_request_pb2 import SlotTypes as ProtoSlotTypes
9
-
10
-
11
- class SlotType(Enum):
12
- PRIMARY = 1
13
- # `REPLICA` overrides the `read_from_replica` configuration. If it's used the request
14
- # will be routed to a replica, even if the strategy is `ALWAYS_FROM_MASTER`.
15
- REPLICA = 2
16
-
17
-
18
- class Route:
19
- def __init__(self) -> None:
20
- pass
21
-
22
-
23
- # cluster routes
24
-
25
-
26
- class AllNodes(Route):
27
- """
28
- Route request to all nodes.
29
- Warning:
30
- Don't use it with write commands, they could be routed to a replica (RO) node and fail.
31
- """
32
-
33
- pass
34
-
35
-
36
- class AllPrimaries(Route):
37
- pass
38
-
39
-
40
- class RandomNode(Route):
41
- """
42
- Route request to a random node.
43
- Warning:
44
- Don't use it with write commands, because they could be randomly routed to a replica (RO) node and fail.
45
- """
46
-
47
- pass
48
-
49
-
50
- class SlotKeyRoute(Route):
51
- def __init__(self, slot_type: SlotType, slot_key: str) -> None:
52
- super().__init__()
53
- self.slot_type = slot_type
54
- self.slot_key = slot_key
55
-
56
-
57
- class SlotIdRoute(Route):
58
- def __init__(self, slot_type: SlotType, slot_id: int) -> None:
59
- super().__init__()
60
- self.slot_type = slot_type
61
- self.slot_id = slot_id
62
-
63
-
64
- class ByAddressRoute(Route):
65
- def __init__(self, host: str, port: Optional[int] = None) -> None:
66
- """Routes a request to a node by its address
67
-
68
- Args:
69
- host (str): The endpoint of the node. If `port` is not provided, should be in the f"{address}:{port}" format, where `address` is the preferred endpoint as shown in the output of the `CLUSTER SLOTS` command.
70
- port (Optional[int]): The port to access on the node. If port is not provided, `host` is assumed to be in the format f"{address}:{port}".
71
- """
72
- super().__init__()
73
- if port is None:
74
- split = host.split(":")
75
- if len(split) < 2:
76
- raise RequestError(
77
- "No port provided, expected host to be formatted as {hostname}:{port}`. Received "
78
- + host
79
- )
80
- self.host = split[0]
81
- self.port = int(split[1])
82
- else:
83
- self.host = host
84
- self.port = port
85
-
86
-
87
- def to_protobuf_slot_type(slot_type: SlotType) -> ProtoSlotTypes.ValueType:
88
- return (
89
- ProtoSlotTypes.Primary
90
- if slot_type == SlotType.PRIMARY
91
- else ProtoSlotTypes.Replica
92
- )
93
-
94
-
95
- def set_protobuf_route(request: CommandRequest, route: Optional[Route]) -> None:
96
- if route is None:
97
- return
98
- elif isinstance(route, AllNodes):
99
- request.route.simple_routes = SimpleRoutes.AllNodes
100
- elif isinstance(route, AllPrimaries):
101
- request.route.simple_routes = SimpleRoutes.AllPrimaries
102
- elif isinstance(route, RandomNode):
103
- request.route.simple_routes = SimpleRoutes.Random
104
- elif isinstance(route, SlotKeyRoute):
105
- request.route.slot_key_route.slot_type = to_protobuf_slot_type(route.slot_type)
106
- request.route.slot_key_route.slot_key = route.slot_key
107
- elif isinstance(route, SlotIdRoute):
108
- request.route.slot_id_route.slot_type = to_protobuf_slot_type(route.slot_type)
109
- request.route.slot_id_route.slot_id = route.slot_id
110
- elif isinstance(route, ByAddressRoute):
111
- request.route.by_address_route.host = route.host
112
- request.route.by_address_route.port = route.port
113
- else:
114
- raise RequestError(f"Received invalid route type: {type(route)}")
@@ -1,122 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: valkey-glide
3
- Version: 1.2.0rc14
4
- Classifier: Topic :: Database
5
- Classifier: Topic :: Utilities
6
- Classifier: License :: OSI Approved :: Apache Software License
7
- Classifier: Intended Audience :: Developers
8
- Classifier: Topic :: Software Development
9
- Classifier: Programming Language :: Rust
10
- Classifier: Programming Language :: Python :: Implementation :: CPython
11
- Classifier: Programming Language :: Python :: Implementation :: PyPy
12
- Requires-Dist: async-timeout>=4.0.2; python_version < '3.11'
13
- Requires-Dist: typing-extensions>=4.8.0; python_version < '3.11'
14
- Requires-Dist: protobuf>=3.20
15
- Author: Valkey GLIDE Maintainers
16
- License: Apache-2.0
17
- Requires-Python: >=3.9
18
- Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
19
-
20
- # Valkey GLIDE
21
-
22
- Valkey General Language Independent Driver for the Enterprise (GLIDE), is an open-source Valkey client library. Valkey GLIDE is one of the official client libraries for Valkey, and it supports all Valkey commands. Valkey GLIDE supports Valkey 7.2 and above, and Redis open-source 6.2, 7.0 and 7.2. Application programmers use Valkey GLIDE to safely and reliably connect their applications to Valkey- and Redis OSS- compatible services. Valkey GLIDE is designed for reliability, optimized performance, and high-availability, for Valkey and Redis OSS based applications. It is sponsored and supported by AWS, and is pre-configured with best practices learned from over a decade of operating Redis OSS-compatible services used by hundreds of thousands of customers. To help ensure consistency in application development and operations, Valkey GLIDE is implemented using a core driver framework, written in Rust, with language specific extensions. This design ensures consistency in features across languages and reduces overall complexity.
23
-
24
- ## Supported Engine Versions
25
-
26
- Refer to the [Supported Engine Versions table](https://github.com/valkey-io/valkey-glide/blob/main/README.md#supported-engine-versions) for details.
27
-
28
- # Getting Started - Python Wrapper
29
-
30
- ## System Requirements
31
-
32
- The release of Valkey GLIDE was tested on the following platforms:
33
-
34
- Linux:
35
-
36
- - Ubuntu 22.04.1 (x86_64 and aarch64)
37
- - Amazon Linux 2023 (AL2023) (x86_64)
38
-
39
- macOS:
40
-
41
- - macOS 14.7 (Apple silicon/aarch_64)
42
-
43
- ## Python Supported Versions
44
-
45
- | Python Version |
46
- |----------------|
47
- | 3.9 |
48
- | 3.10 |
49
- | 3.11 |
50
- | 3.12 |
51
- | 3.13 |
52
-
53
- ## Installation and Setup
54
-
55
- ### Installing via Package Manager (pip)
56
-
57
- To install Valkey GLIDE using `pip`, follow these steps:
58
-
59
- 1. Open your terminal.
60
- 2. Execute the command below:
61
- ```bash
62
- $ pip install valkey-glide
63
- ```
64
- 3. After installation, confirm the client is accessible by running:
65
- ```bash
66
- $ python3
67
- >>> import glide
68
- ```
69
-
70
- ## Basic Examples
71
-
72
- #### Cluster Mode:
73
-
74
- ```python:
75
- >>> import asyncio
76
- >>> from glide import GlideClusterClientConfiguration, NodeAddress, GlideClusterClient
77
- >>> async def test_cluster_client():
78
- ... addresses = [NodeAddress("address.example.com", 6379)]
79
- ... config = GlideClusterClientConfiguration(addresses)
80
- ... client = await GlideClusterClient.create(config)
81
- ... set_result = await client.set("foo", "bar")
82
- ... print(f"Set response is {set_result}")
83
- ... get_result = await client.get("foo")
84
- ... print(f"Get response is {get_result}")
85
- ...
86
- >>> asyncio.run(test_cluster_client())
87
- Set response is OK
88
- Get response is bar
89
- ```
90
-
91
- #### Standalone Mode:
92
-
93
- ```python:
94
- >>> import asyncio
95
- >>> from glide import GlideClientConfiguration, NodeAddress, GlideClient
96
- >>> async def test_standalone_client():
97
- ... addresses = [
98
- ... NodeAddress("server_primary.example.com", 6379),
99
- ... NodeAddress("server_replica.example.com", 6379)
100
- ... ]
101
- ... config = GlideClientConfiguration(addresses)
102
- ... client = await GlideClient.create(config)
103
- ... set_result = await client.set("foo", "bar")
104
- ... print(f"Set response is {set_result}")
105
- ... get_result = await client.get("foo")
106
- ... print(f"Get response is {get_result}")
107
- ...
108
- >>> asyncio.run(test_standalone_client())
109
- Set response is OK
110
- Get response is bar
111
- ```
112
-
113
- For complete examples with error handling, please refer to the [cluster example](https://github.com/valkey-io/valkey-glide/blob/main/examples/python/cluster_example.py) and the [standalone example](https://github.com/valkey-io/valkey-glide/blob/main/examples/python/standalone_example.py).
114
-
115
- ## Documentation
116
-
117
- Visit our [wiki](https://github.com/valkey-io/valkey-glide/wiki/Python-wrapper) for examples and further details on TLS, Read strategy, Timeouts and various other configurations.
118
-
119
- ### Building & Testing
120
-
121
- Development instructions for local building & testing the package are in the [DEVELOPER.md](https://github.com/valkey-io/valkey-glide/blob/main/python/DEVELOPER.md#build-from-source) file.
122
-