valkey-glide 2.0.0rc3__cp310-cp310-macosx_11_0_arm64.whl → 2.2.1rc3__cp310-cp310-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 (45) hide show
  1. glide/__init__.py +160 -106
  2. glide/async_commands/cluster_commands.py +108 -105
  3. glide/async_commands/core.py +637 -444
  4. glide/async_commands/{server_modules/ft.py → ft.py} +8 -7
  5. glide/async_commands/{server_modules/glide_json.py → glide_json.py} +15 -92
  6. glide/async_commands/standalone_commands.py +27 -58
  7. glide/glide.cpython-310-darwin.so +0 -0
  8. glide/glide.pyi +26 -1
  9. glide/glide_client.py +269 -125
  10. glide/logger.py +33 -21
  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 → glide_shared/commands}/batch.py +476 -64
  15. glide_shared/commands/batch_options.py +261 -0
  16. glide_shared/commands/core_options.py +407 -0
  17. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_aggregate_options.py +3 -3
  18. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_create_options.py +4 -2
  19. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_profile_options.py +4 -4
  20. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_search_options.py +4 -2
  21. {glide/async_commands → glide_shared/commands}/server_modules/json_batch.py +4 -4
  22. glide_shared/commands/server_modules/json_options.py +93 -0
  23. {glide/async_commands → glide_shared/commands}/sorted_set.py +2 -2
  24. {glide/async_commands → glide_shared/commands}/stream.py +1 -1
  25. {glide → glide_shared}/config.py +386 -61
  26. {glide → glide_shared}/constants.py +3 -3
  27. {glide → glide_shared}/exceptions.py +27 -1
  28. glide_shared/protobuf/command_request_pb2.py +56 -0
  29. glide_shared/protobuf/connection_request_pb2.py +56 -0
  30. {glide → glide_shared}/protobuf/response_pb2.py +6 -6
  31. {glide → glide_shared}/routes.py +54 -15
  32. valkey_glide-2.2.1rc3.dist-info/METADATA +210 -0
  33. valkey_glide-2.2.1rc3.dist-info/RECORD +40 -0
  34. glide/protobuf/command_request_pb2.py +0 -54
  35. glide/protobuf/command_request_pb2.pyi +0 -1187
  36. glide/protobuf/connection_request_pb2.py +0 -54
  37. glide/protobuf/connection_request_pb2.pyi +0 -320
  38. glide/protobuf/response_pb2.pyi +0 -100
  39. valkey_glide-2.0.0rc3.dist-info/METADATA +0 -127
  40. valkey_glide-2.0.0rc3.dist-info/RECORD +0 -37
  41. {glide/async_commands → glide_shared/commands}/bitmap.py +0 -0
  42. {glide/async_commands → glide_shared/commands}/command_args.py +0 -0
  43. {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_constants.py +0 -0
  44. {glide → glide_shared}/protobuf_codec.py +0 -0
  45. {valkey_glide-2.0.0rc3.dist-info → valkey_glide-2.2.1rc3.dist-info}/WHEEL +0 -0
@@ -2,16 +2,16 @@
2
2
  from enum import Enum
3
3
  from typing import List, Optional, Union, cast
4
4
 
5
- from glide.async_commands.server_modules.ft_options.ft_aggregate_options import (
5
+ from glide_shared.commands.server_modules.ft_options.ft_aggregate_options import (
6
6
  FtAggregateOptions,
7
7
  )
8
- from glide.async_commands.server_modules.ft_options.ft_constants import (
8
+ from glide_shared.commands.server_modules.ft_options.ft_constants import (
9
9
  FtProfileKeywords,
10
10
  )
11
- from glide.async_commands.server_modules.ft_options.ft_search_options import (
11
+ from glide_shared.commands.server_modules.ft_options.ft_search_options import (
12
12
  FtSearchOptions,
13
13
  )
14
- from glide.constants import TEncodable
14
+ from glide_shared.constants import TEncodable
15
15
 
16
16
 
17
17
  class QueryType(Enum):
@@ -2,8 +2,10 @@
2
2
 
3
3
  from typing import List, Mapping, Optional
4
4
 
5
- from glide.async_commands.server_modules.ft_options.ft_constants import FtSearchKeywords
6
- from glide.constants import TEncodable
5
+ from glide_shared.commands.server_modules.ft_options.ft_constants import (
6
+ FtSearchKeywords,
7
+ )
8
+ from glide_shared.constants import TEncodable
7
9
 
8
10
 
9
11
  class FtSearchLimit:
@@ -22,14 +22,14 @@ Examples:
22
22
 
23
23
  from typing import List, Optional, Union
24
24
 
25
- from glide.async_commands.batch import TBatch
26
- from glide.async_commands.core import ConditionalChange
27
- from glide.async_commands.server_modules.glide_json import (
25
+ from glide_shared.commands.batch import TBatch
26
+ from glide_shared.commands.core_options import ConditionalChange
27
+ from glide_shared.commands.server_modules.json_options import (
28
28
  JsonArrIndexOptions,
29
29
  JsonArrPopOptions,
30
30
  JsonGetOptions,
31
31
  )
32
- from glide.constants import TEncodable
32
+ from glide_shared.constants import TEncodable
33
33
 
34
34
 
35
35
  def set(
@@ -0,0 +1,93 @@
1
+ # Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
2
+
3
+ from typing import List, Optional
4
+
5
+ from glide_shared.constants import TEncodable
6
+
7
+
8
+ class JsonArrIndexOptions:
9
+ """
10
+ Options for the `JSON.ARRINDEX` command.
11
+
12
+ Args:
13
+ start (int): The inclusive start index from which the search begins. Defaults to None.
14
+ end (Optional[int]): The exclusive end index where the search stops. Defaults to None.
15
+
16
+ Note:
17
+ - If `start` is greater than `end`, the command returns `-1` to indicate that the value was not found.
18
+ - Indices that exceed the array bounds are automatically adjusted to the nearest valid position.
19
+ """
20
+
21
+ def __init__(self, start: int, end: Optional[int] = None):
22
+ self.start = start
23
+ self.end = end
24
+
25
+ def to_args(self) -> List[str]:
26
+ """
27
+ Get the options as a list of arguments for the JSON.ARRINDEX command.
28
+
29
+ Returns:
30
+ List[str]: A list containing the start and end indices if specified.
31
+ """
32
+ args = [str(self.start)]
33
+ if self.end is not None:
34
+ args.append(str(self.end))
35
+ return args
36
+
37
+
38
+ class JsonArrPopOptions:
39
+ """
40
+ Options for the JSON.ARRPOP command.
41
+
42
+ Args:
43
+ path (TEncodable): The path within the JSON document.
44
+ index (Optional[int]): The index of the element to pop. If not specified, will pop the last element.
45
+ Out of boundary indexes are rounded to their respective array boundaries. Defaults to None.
46
+ """
47
+
48
+ def __init__(self, path: TEncodable, index: Optional[int] = None):
49
+ self.path = path
50
+ self.index = index
51
+
52
+ def to_args(self) -> List[TEncodable]:
53
+ """
54
+ Get the options as a list of arguments for the `JSON.ARRPOP` command.
55
+
56
+ Returns:
57
+ List[TEncodable]: A list containing the path and, if specified, the index.
58
+ """
59
+ args = [self.path]
60
+ if self.index is not None:
61
+ args.append(str(self.index))
62
+ return args
63
+
64
+
65
+ class JsonGetOptions:
66
+ """
67
+ Represents options for formatting JSON data, to be used in the [JSON.GET](https://valkey.io/commands/json.get/) command.
68
+
69
+ Args:
70
+ indent (Optional[str]): Sets an indentation string for nested levels. Defaults to None.
71
+ newline (Optional[str]): Sets a string that's printed at the end of each line. Defaults to None.
72
+ space (Optional[str]): Sets a string that's put between a key and a value. Defaults to None.
73
+ """
74
+
75
+ def __init__(
76
+ self,
77
+ indent: Optional[str] = None,
78
+ newline: Optional[str] = None,
79
+ space: Optional[str] = None,
80
+ ):
81
+ self.indent = indent
82
+ self.new_line = newline
83
+ self.space = space
84
+
85
+ def get_options(self) -> List[str]:
86
+ args = []
87
+ if self.indent:
88
+ args.extend(["INDENT", self.indent])
89
+ if self.new_line:
90
+ args.extend(["NEWLINE", self.new_line])
91
+ if self.space:
92
+ args.extend(["SPACE", self.space])
93
+ return args
@@ -3,8 +3,8 @@
3
3
  from enum import Enum
4
4
  from typing import List, Optional, Tuple, Union, cast
5
5
 
6
- from glide.async_commands.command_args import Limit, OrderBy
7
- from glide.constants import TEncodable
6
+ from glide_shared.commands.command_args import Limit, OrderBy
7
+ from glide_shared.constants import TEncodable
8
8
 
9
9
 
10
10
  class InfBound(Enum):
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
  from abc import ABC, abstractmethod
5
5
  from typing import List, Optional, Union
6
6
 
7
- from glide.constants import TEncodable
7
+ from glide_shared.constants import TEncodable
8
8
 
9
9
 
10
10
  class StreamTrimOptions(ABC):