graph LR
Valkey_Client_Core["Valkey Client Core"]
Valkey_Cluster_Sentinel_Clients["Valkey Cluster & Sentinel Clients"]
Connection_Pooling["Connection & Pooling"]
Valkey_Command_Interfaces["Valkey Command Interfaces"]
Protocol_Data_Serialization["Protocol & Data Serialization"]
Resilience_Error_Handling["Resilience & Error Handling"]
Distributed_Locking["Distributed Locking"]
Security_Performance_Enhancements["Security & Performance Enhancements"]
Development_Testing_Utilities["Development & Testing Utilities"]
Valkey_Client_Core -- "uses" --> Connection_Pooling
Valkey_Client_Core -- "uses" --> Protocol_Data_Serialization
Valkey_Client_Core -- "executes" --> Valkey_Command_Interfaces
Valkey_Client_Core -- "uses" --> Distributed_Locking
Valkey_Client_Core -- "interacts with" --> Resilience_Error_Handling
Valkey_Client_Core -- "uses" --> Security_Performance_Enhancements
Valkey_Cluster_Sentinel_Clients -- "uses" --> Connection_Pooling
Valkey_Cluster_Sentinel_Clients -- "uses" --> Protocol_Data_Serialization
Valkey_Cluster_Sentinel_Clients -- "executes" --> Valkey_Command_Interfaces
Valkey_Cluster_Sentinel_Clients -- "interacts with" --> Resilience_Error_Handling
Valkey_Cluster_Sentinel_Clients -- "uses" --> Security_Performance_Enhancements
Connection_Pooling -- "uses" --> Protocol_Data_Serialization
Connection_Pooling -- "uses" --> Security_Performance_Enhancements
Connection_Pooling -- "interacts with" --> Resilience_Error_Handling
Valkey_Command_Interfaces -- "are executed by" --> Valkey_Client_Core
Valkey_Command_Interfaces -- "are executed by" --> Valkey_Cluster_Sentinel_Clients
Protocol_Data_Serialization -- "depends on" --> Resilience_Error_Handling
Distributed_Locking -- "depends on" --> Valkey_Client_Core
Security_Performance_Enhancements -- "is used by" --> Connection_Pooling
Security_Performance_Enhancements -- "is used by" --> Valkey_Client_Core
Development_Testing_Utilities -- "interacts with" --> Valkey_Client_Core
Development_Testing_Utilities -- "interacts with" --> Valkey_Cluster_Sentinel_Clients
click Valkey_Client_Core href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Valkey Client Core.md" "Details"
click Valkey_Cluster_Sentinel_Clients href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Valkey Cluster & Sentinel Clients.md" "Details"
click Connection_Pooling href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Connection & Pooling.md" "Details"
click Valkey_Command_Interfaces href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Valkey Command Interfaces.md" "Details"
click Protocol_Data_Serialization href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Protocol & Data Serialization.md" "Details"
click Resilience_Error_Handling href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Resilience & Error Handling.md" "Details"
click Distributed_Locking href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Distributed Locking.md" "Details"
click Security_Performance_Enhancements href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Security & Performance Enhancements.md" "Details"
click Development_Testing_Utilities href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/valkey-py/Development & Testing Utilities.md" "Details"
The valkey-py library provides a comprehensive client for interacting with Valkey, supporting both synchronous and asynchronous operations, as well as specialized clients for Valkey Cluster and Sentinel environments. Its core functionality revolves around managing connections, encoding/decoding Valkey protocols, and exposing a rich set of Valkey commands, while also incorporating features for resilience, distributed locking, and performance optimization.
Provides the fundamental synchronous and asynchronous interfaces for interacting with Valkey, including basic commands, pipelining, PubSub, and monitoring. It serves as the primary entry point for most Valkey operations.
Related Classes/Methods:
valkey-py.valkey.client.Valkey(92:619)valkey-py.valkey.client.Pipeline(1224:1569)valkey-py.valkey.client.PubSub(692:1182)valkey-py.valkey.client.Monitor(625:689)valkey-py.valkey.client.CaseInsensitiveDict(61:85)valkey-py.valkey.asyncio.client.Valkey(101:694)valkey-py.valkey.asyncio.client.Pipeline(1229:1595)valkey-py.valkey.asyncio.client.PubSub(782:1209)valkey-py.valkey.asyncio.client.Monitor(709:779)
Manages connections and operations for both synchronous and asynchronous clients within Valkey Cluster and Sentinel environments, handling node discovery, slot mapping, failover, and intelligent command routing.
Related Classes/Methods:
valkey-py.valkey.cluster.ValkeyCluster(452:1276)valkey-py.valkey.cluster.NodesManager(1338:1694)valkey-py.valkey.cluster.ClusterPubSub(1697:1927)valkey-py.valkey.cluster.ClusterPipeline(1930:2361)valkey-py.valkey.cluster.ClusterNode(1279:1316)valkey-py.valkey.asyncio.cluster.ValkeyCluster(99:959)valkey-py.valkey.asyncio.cluster.NodesManager(1145:1442)valkey-py.valkey.asyncio.cluster.ClusterNode(962:1142)valkey-py.valkey.asyncio.cluster.ClusterPipeline(1445:1686)valkey-py.valkey.sentinel.Sentinel(203:406)valkey-py.valkey.sentinel.SentinelConnectionPool(142:200)valkey-py.valkey.sentinel.SentinelManagedConnection(25:87)valkey-py.valkey.asyncio.sentinel.Sentinel(176:389)valkey-py.valkey.asyncio.sentinel.SentinelConnectionPool(105:173)valkey-py.valkey.asyncio.sentinel.SentinelManagedConnection(31:98)
Manages the underlying synchronous and asynchronous network connections to Valkey servers, including connection pooling, SSL/TLS encryption, Unix domain socket support, and health checks.
Related Classes/Methods:
valkey-py.valkey.connection.ConnectionPool(952:1235)valkey-py.valkey.connection.AbstractConnection(147:676)valkey-py.valkey.connection.Connection(679:746)valkey-py.valkey.connection.SSLConnection(749:915)valkey-py.valkey.connection.UnixDomainSocketConnection(918:946)valkey-py.valkey.connection.BlockingConnectionPool(1238:1395)valkey-py.valkey.asyncio.connection.ConnectionPool(969:1174)valkey-py.valkey.asyncio.connection.AbstractConnection(99:745)valkey-py.valkey.asyncio.connection.Connection(748:802)valkey-py.valkey.asyncio.connection.SSLConnection(805:866)valkey-py.valkey.asyncio.connection.UnixDomainSocketConnection(932:953)valkey-py.valkey.asyncio.connection.BlockingConnectionPool(1177:1249)
Implements the various standard Valkey commands and interfaces for interacting with Valkey modules (e.g., JSON, Search, TimeSeries, Probabilistic Data Structures, Graph). These classes provide the methods for interacting with Valkey data structures and extended functionalities.
Related Classes/Methods:
valkey-py.valkey.commands.core.ACLCommands(55:386)valkey-py.valkey.commands.core.ManagementCommands(392:1383)valkey-py.valkey.commands.core.BasicKeyCommands(1549:2541)valkey-py.valkey.commands.valkeymodules.ValkeyModuleCommands(4:83)valkey-py.valkey.commands.json.JSON(full file reference)valkey-py.valkey.commands.search.Search(full file reference)valkey-py.valkey.commands.timeseries.TimeSeries(full file reference)valkey-py.valkey.commands.bf.BFBloom(full file reference)valkey-py.valkey.commands.graph.Graph(full file reference)valkey-py.valkey.commands.core.AsyncBasicKeyCommands(2544:2561)valkey-py.valkey.commands.search.AsyncSearch(full file reference)valkey-py.valkey.commands.graph.AsyncGraph(full file reference)
Responsible for encoding commands into the Valkey protocol format (RESP2, RESP3) and decoding responses received from the Valkey server. It also handles low-level socket buffer operations and URL parsing for connection strings.
Related Classes/Methods:
valkey-py.valkey._parsers.encoders.Encoder(4:44)valkey-py.valkey._parsers.socket.SocketBuffer(29:162)valkey-py.valkey._parsers.resp3._RESP3Parser(12:142)valkey-py.valkey._parsers.resp2._RESP2Parser(9:68)valkey-py.valkey._parsers.libvalkey._LibvalkeyParser(35:145)valkey-py.valkey._parsers.base.BaseParser(48:93)valkey-py.valkey._parsers.commands.CommandsParser(56:170)valkey-py.valkey._parsers.helpers(full file reference)valkey-py.valkey._parsers.url_parser(full file reference)valkey-py.valkey.utils(full file reference)
Provides mechanisms for retrying failed operations with configurable backoff strategies and defines custom exception classes for various error conditions, ensuring robust and structured error management.
Related Classes/Methods:
valkey-py.valkey.retry.Retry(13:70)valkey-py.valkey.backoff.NoBackoff(38:42)valkey-py.valkey.backoff.default_backoff(113:114)valkey-py.valkey.exceptions(full file reference)
Implements distributed locking mechanisms for managing concurrent access to resources across multiple clients, ensuring atomicity and consistency in a distributed environment.
Related Classes/Methods:
Handles Online Certificate Status Protocol (OCSP) verification for SSL/TLS connections to ensure certificate validity and implements a local cache for frequently accessed data to reduce network round trips and improve performance.
Related Classes/Methods:
valkey-py.valkey.ocsp.OCSPVerifier(169:307)valkey-py.valkey.ocsp(full file reference)valkey-py.valkey._cache._LocalCache(199:385)
Contains scripts and modules for benchmarking the performance of Valkey operations and defines high-level development tasks such as environment setup, linting, and test execution.
Related Classes/Methods:
valkey-py.benchmarks.basic_operations(full file reference)valkey-py.benchmarks.command_packer_benchmark.StringJoiningConnection(6:37)valkey-py.benchmarks.command_packer_benchmark.ListJoiningConnection(40:77)valkey-py.benchmarks.cluster_async_pipeline(full file reference)valkey-py.benchmarks.base.Benchmark(9:44)valkey-py.benchmarks.cluster_async(full file reference)valkey-py.tasks:devenv(13:17)valkey-py.tasks:all_tests(38:41)valkey-py.tasks:tests(45:51)