Synchronous Redis client implementing the Redis protocol, providing a Python interface to all Redis commands, connection pooling, pipelines, pub/sub, and locking.
class Redis(RedisModuleCommands, CoreCommands, SentinelCommands):
"""
Implementation of the Redis protocol.
This abstract class provides a Python interface to all Redis commands
and an implementation of the Redis protocol.
Pipelines derive from this, implementing how
the commands are sent and received to the Redis server. Based on
configuration, an instance will either use a ConnectionPool, or
Connection object to talk to redis.
It is not safe to pass PubSub or Pipeline objects between threads.
"""
# Type discrimination marker for @overload self-type pattern
_is_async_client: Literal[False] = False
@classmethod
def from_url(cls, url: str, **kwargs) -> "Redis":
"""
Return a Redis client object configured from the g
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key