From 83a633efa971c24d55c9fecb51058a869d42db1e Mon Sep 17 00:00:00 2001 From: Hunter Hogan Date: Mon, 28 Jul 2025 20:30:02 -0500 Subject: [PATCH] typos in core.py --- redis/commands/core.py | 564 ++++++++++++++++++++--------------------- 1 file changed, 282 insertions(+), 282 deletions(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index d6fb550724..43c2305d83 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -71,7 +71,7 @@ def acl_cat(self, category: Optional[str] = None, **kwargs) -> ResponseT: If ``category`` is supplied, returns a list of all commands within that category. - For more information see https://redis.io/commands/acl-cat + For more information, see https://redis.io/commands/acl-cat """ pieces: list[EncodableT] = [category] if category else [] return self.execute_command("ACL CAT", *pieces, **kwargs) @@ -80,7 +80,7 @@ def acl_dryrun(self, username, *args, **kwargs): """ Simulate the execution of a given command by a given ``username``. - For more information see https://redis.io/commands/acl-dryrun + For more information, see https://redis.io/commands/acl-dryrun """ return self.execute_command("ACL DRYRUN", username, *args, **kwargs) @@ -88,7 +88,7 @@ def acl_deluser(self, *username: str, **kwargs) -> ResponseT: """ Delete the ACL for the specified ``username``\\s - For more information see https://redis.io/commands/acl-deluser + For more information, see https://redis.io/commands/acl-deluser """ return self.execute_command("ACL DELUSER", *username, **kwargs) @@ -117,7 +117,7 @@ def acl_getuser(self, username: str, **kwargs) -> ResponseT: If ``username`` does not exist, return None - For more information see https://redis.io/commands/acl-getuser + For more information, see https://redis.io/commands/acl-getuser """ return self.execute_command("ACL GETUSER", username, **kwargs) @@ -125,7 +125,7 @@ def acl_help(self, **kwargs) -> ResponseT: """The ACL HELP command returns helpful text describing the different subcommands. - For more information see https://redis.io/commands/acl-help + For more information, see https://redis.io/commands/acl-help """ return self.execute_command("ACL HELP", **kwargs) @@ -133,7 +133,7 @@ def acl_list(self, **kwargs) -> ResponseT: """ Return a list of all ACLs on the server - For more information see https://redis.io/commands/acl-list + For more information, see https://redis.io/commands/acl-list """ return self.execute_command("ACL LIST", **kwargs) @@ -143,7 +143,7 @@ def acl_log(self, count: Optional[int] = None, **kwargs) -> ResponseT: :param int count: Get logs[0:count]. :rtype: List. - For more information see https://redis.io/commands/acl-log + For more information, see https://redis.io/commands/acl-log """ args = [] if count is not None: @@ -158,7 +158,7 @@ def acl_log_reset(self, **kwargs) -> ResponseT: Reset ACL logs. :rtype: Boolean. - For more information see https://redis.io/commands/acl-log + For more information, see https://redis.io/commands/acl-log """ args = [b"RESET"] return self.execute_command("ACL LOG", *args, **kwargs) @@ -170,7 +170,7 @@ def acl_load(self, **kwargs) -> ResponseT: Note that the server must be configured with the ``aclfile`` directive to be able to load ACL rules from an aclfile. - For more information see https://redis.io/commands/acl-load + For more information, see https://redis.io/commands/acl-load """ return self.execute_command("ACL LOAD", **kwargs) @@ -181,7 +181,7 @@ def acl_save(self, **kwargs) -> ResponseT: Note that the server must be configured with the ``aclfile`` directive to be able to save ACL rules to an aclfile. - For more information see https://redis.io/commands/acl-save + For more information, see https://redis.io/commands/acl-save """ return self.execute_command("ACL SAVE", **kwargs) @@ -379,14 +379,14 @@ def acl_setuser( def acl_users(self, **kwargs) -> ResponseT: """Returns a list of all registered users on the server. - For more information see https://redis.io/commands/acl-users + For more information, see https://redis.io/commands/acl-users """ return self.execute_command("ACL USERS", **kwargs) def acl_whoami(self, **kwargs) -> ResponseT: """Get the username for the current connection - For more information see https://redis.io/commands/acl-whoami + For more information, see https://redis.io/commands/acl-whoami """ return self.execute_command("ACL WHOAMI", **kwargs) @@ -404,7 +404,7 @@ def auth(self, password: str, username: Optional[str] = None, **kwargs): Authenticates the user. If you do not pass username, Redis will try to authenticate for the "default" user. If you do pass username, it will authenticate for the given user. - For more information see https://redis.io/commands/auth + For more information, see https://redis.io/commands/auth """ pieces = [] if username is not None: @@ -415,7 +415,7 @@ def auth(self, password: str, username: Optional[str] = None, **kwargs): def bgrewriteaof(self, **kwargs): """Tell the Redis server to rewrite the AOF file from data in memory. - For more information see https://redis.io/commands/bgrewriteaof + For more information, see https://redis.io/commands/bgrewriteaof """ return self.execute_command("BGREWRITEAOF", **kwargs) @@ -424,7 +424,7 @@ def bgsave(self, schedule: bool = True, **kwargs) -> ResponseT: Tell the Redis server to save its data to disk. Unlike save(), this method is asynchronous and returns immediately. - For more information see https://redis.io/commands/bgsave + For more information, see https://redis.io/commands/bgsave """ pieces = [] if schedule: @@ -437,14 +437,14 @@ def role(self) -> ResponseT: the context of replication, by returning if the instance is currently a master, slave, or sentinel. - For more information see https://redis.io/commands/role + For more information, see https://redis.io/commands/role """ return self.execute_command("ROLE") def client_kill(self, address: str, **kwargs) -> ResponseT: """Disconnects the client at ``address`` (ip:port) - For more information see https://redis.io/commands/client-kill + For more information, see https://redis.io/commands/client-kill """ return self.execute_command("CLIENT KILL", address, **kwargs) @@ -507,7 +507,7 @@ def client_info(self, **kwargs) -> ResponseT: Returns information and statistics about the current client connection. - For more information see https://redis.io/commands/client-info + For more information, see https://redis.io/commands/client-info """ return self.execute_command("CLIENT INFO", **kwargs) @@ -522,7 +522,7 @@ def client_list( replica, pubsub) :param client_id: optional. a list of client ids - For more information see https://redis.io/commands/client-list + For more information, see https://redis.io/commands/client-list """ args = [] if _type is not None: @@ -542,7 +542,7 @@ def client_getname(self, **kwargs) -> ResponseT: """ Returns the current connection name - For more information see https://redis.io/commands/client-getname + For more information, see https://redis.io/commands/client-getname """ return self.execute_command("CLIENT GETNAME", **kwargs) @@ -583,7 +583,7 @@ def client_id(self, **kwargs) -> ResponseT: """ Returns the current connection id - For more information see https://redis.io/commands/client-id + For more information, see https://redis.io/commands/client-id """ return self.execute_command("CLIENT ID", **kwargs) @@ -598,7 +598,7 @@ def client_tracking_on( ) -> ResponseT: """ Turn on the tracking mode. - For more information about the options look at client_tracking func. + For more information, about the options look at client_tracking func. See https://redis.io/commands/client-tracking """ @@ -617,7 +617,7 @@ def client_tracking_off( ) -> ResponseT: """ Turn off the tracking mode. - For more information about the options look at client_tracking func. + For more information, about the options look at client_tracking func. See https://redis.io/commands/client-tracking """ @@ -640,7 +640,7 @@ def client_tracking( Enables the tracking feature of the Redis server, that is used for server assisted client side caching. - ``on`` indicate for tracking on or tracking off. The dafualt is on. + ``on`` indicate for tracking on or tracking off. The default is on. ``clientid`` send invalidation messages to the connection with the specified ID. @@ -698,7 +698,7 @@ def client_setname(self, name: str, **kwargs) -> ResponseT: """ Sets the current connection name - For more information see https://redis.io/commands/client-setname + For more information, see https://redis.io/commands/client-setname .. note:: This method sets client name only for **current** connection. @@ -724,7 +724,7 @@ def client_unblock( If ``error`` is False (default), the client is unblocked using the regular timeout mechanism. - For more information see https://redis.io/commands/client-unblock + For more information, see https://redis.io/commands/client-unblock """ args = ["CLIENT UNBLOCK", int(client_id)] if error: @@ -736,7 +736,7 @@ def client_pause(self, timeout: int, all: bool = True, **kwargs) -> ResponseT: Suspend all the Redis clients for the specified amount of time. - For more information see https://redis.io/commands/client-pause + For more information, see https://redis.io/commands/client-pause Args: timeout: milliseconds to pause clients @@ -763,7 +763,7 @@ def client_unpause(self, **kwargs) -> ResponseT: """ Unpause all redis clients - For more information see https://redis.io/commands/client-unpause + For more information, see https://redis.io/commands/client-unpause """ return self.execute_command("CLIENT UNPAUSE", **kwargs) @@ -771,7 +771,7 @@ def client_no_evict(self, mode: str) -> Union[Awaitable[str], str]: """ Sets the client eviction mode for the current connection. - For more information see https://redis.io/commands/client-no-evict + For more information, see https://redis.io/commands/client-no-evict """ return self.execute_command("CLIENT NO-EVICT", mode) @@ -782,7 +782,7 @@ def client_no_touch(self, mode: str) -> Union[Awaitable[str], str]: # When turned on, the current client will not change LFU/LRU stats, # unless it sends the TOUCH command. - For more information see https://redis.io/commands/client-no-touch + For more information, see https://redis.io/commands/client-no-touch """ return self.execute_command("CLIENT NO-TOUCH", mode) @@ -790,7 +790,7 @@ def command(self, **kwargs): """ Returns dict reply of details about all Redis commands. - For more information see https://redis.io/commands/command + For more information, see https://redis.io/commands/command """ return self.execute_command("COMMAND", **kwargs) @@ -815,7 +815,7 @@ def command_list( ``category``: get the commands in the ACL category ``pattern``: get the commands that match the given pattern - For more information see https://redis.io/commands/command-list/ + For more information, see https://redis.io/commands/command-list/ """ pieces = [] if module is not None: @@ -834,7 +834,7 @@ def command_getkeysandflags(self, *args: List[str]) -> List[Union[str, List[str] """ Returns array of keys from a full Redis command and their usage flags. - For more information see https://redis.io/commands/command-getkeysandflags + For more information, see https://redis.io/commands/command-getkeysandflags """ return self.execute_command("COMMAND GETKEYSANDFLAGS", *args) @@ -853,7 +853,7 @@ def config_get( """ Return a dictionary of configuration based on the ``pattern`` - For more information see https://redis.io/commands/config-get + For more information, see https://redis.io/commands/config-get """ return self.execute_command("CONFIG GET", pattern, *args, **kwargs) @@ -866,7 +866,7 @@ def config_set( ) -> ResponseT: """Set config item ``name`` with ``value`` - For more information see https://redis.io/commands/config-set + For more information, see https://redis.io/commands/config-set """ return self.execute_command("CONFIG SET", name, value, *args, **kwargs) @@ -874,7 +874,7 @@ def config_resetstat(self, **kwargs) -> ResponseT: """ Reset runtime statistics - For more information see https://redis.io/commands/config-resetstat + For more information, see https://redis.io/commands/config-resetstat """ return self.execute_command("CONFIG RESETSTAT", **kwargs) @@ -882,7 +882,7 @@ def config_rewrite(self, **kwargs) -> ResponseT: """ Rewrite config file with the minimal change to reflect running config. - For more information see https://redis.io/commands/config-rewrite + For more information, see https://redis.io/commands/config-rewrite """ return self.execute_command("CONFIG REWRITE", **kwargs) @@ -890,7 +890,7 @@ def dbsize(self, **kwargs) -> ResponseT: """ Returns the number of keys in the current database - For more information see https://redis.io/commands/dbsize + For more information, see https://redis.io/commands/dbsize """ return self.execute_command("DBSIZE", **kwargs) @@ -898,7 +898,7 @@ def debug_object(self, key: KeyT, **kwargs) -> ResponseT: """ Returns version specific meta information about a given key - For more information see https://redis.io/commands/debug-object + For more information, see https://redis.io/commands/debug-object """ return self.execute_command("DEBUG OBJECT", key, **kwargs) @@ -907,7 +907,7 @@ def debug_segfault(self, **kwargs) -> None: """ DEBUG SEGFAULT is intentionally not implemented in the client. - For more information see https://redis.io/commands/debug-segfault + For more information, see https://redis.io/commands/debug-segfault """ ) @@ -915,7 +915,7 @@ def echo(self, value: EncodableT, **kwargs) -> ResponseT: """ Echo the string back from the server - For more information see https://redis.io/commands/echo + For more information, see https://redis.io/commands/echo """ return self.execute_command("ECHO", value, **kwargs) @@ -926,7 +926,7 @@ def flushall(self, asynchronous: bool = False, **kwargs) -> ResponseT: ``asynchronous`` indicates whether the operation is executed asynchronously by the server. - For more information see https://redis.io/commands/flushall + For more information, see https://redis.io/commands/flushall """ args = [] if asynchronous: @@ -940,7 +940,7 @@ def flushdb(self, asynchronous: bool = False, **kwargs) -> ResponseT: ``asynchronous`` indicates whether the operation is executed asynchronously by the server. - For more information see https://redis.io/commands/flushdb + For more information, see https://redis.io/commands/flushdb """ args = [] if asynchronous: @@ -951,7 +951,7 @@ def sync(self) -> ResponseT: """ Initiates a replication stream from the master. - For more information see https://redis.io/commands/sync + For more information, see https://redis.io/commands/sync """ from redis.client import NEVER_DECODE @@ -964,7 +964,7 @@ def psync(self, replicationid: str, offset: int): Initiates a replication stream from the master. Newer version for `sync`. - For more information see https://redis.io/commands/sync + For more information, see https://redis.io/commands/sync """ from redis.client import NEVER_DECODE @@ -976,7 +976,7 @@ def swapdb(self, first: int, second: int, **kwargs) -> ResponseT: """ Swap two databases - For more information see https://redis.io/commands/swapdb + For more information, see https://redis.io/commands/swapdb """ return self.execute_command("SWAPDB", first, second, **kwargs) @@ -999,7 +999,7 @@ def info( The section option is not supported by older versions of Redis Server, and will generate ResponseError - For more information see https://redis.io/commands/info + For more information, see https://redis.io/commands/info """ if section is None: return self.execute_command("INFO", **kwargs) @@ -1011,35 +1011,35 @@ def lastsave(self, **kwargs) -> ResponseT: Return a Python datetime object representing the last time the Redis database was saved to disk - For more information see https://redis.io/commands/lastsave + For more information, see https://redis.io/commands/lastsave """ return self.execute_command("LASTSAVE", **kwargs) def latency_doctor(self): """Raise a NotImplementedError, as the client will not support LATENCY DOCTOR. - This funcion is best used within the redis-cli. + This function is best used within the redis-cli. - For more information see https://redis.io/commands/latency-doctor + For more information, see https://redis.io/commands/latency-doctor """ raise NotImplementedError( """ LATENCY DOCTOR is intentionally not implemented in the client. - For more information see https://redis.io/commands/latency-doctor + For more information, see https://redis.io/commands/latency-doctor """ ) def latency_graph(self): """Raise a NotImplementedError, as the client will not support LATENCY GRAPH. - This funcion is best used within the redis-cli. + This function is best used within the redis-cli. - For more information see https://redis.io/commands/latency-graph. + For more information, see https://redis.io/commands/latency-graph. """ raise NotImplementedError( """ LATENCY GRAPH is intentionally not implemented in the client. - For more information see https://redis.io/commands/latency-graph + For more information, see https://redis.io/commands/latency-graph """ ) @@ -1055,7 +1055,7 @@ def lolwut(self, *version_numbers: Union[str, float], **kwargs) -> ResponseT: return self.execute_command("LOLWUT", **kwargs) def reset(self) -> ResponseT: - """Perform a full reset on the connection's server side contenxt. + """Perform a full reset on the connection's server-side context. See: https://redis.io/commands/reset """ @@ -1090,7 +1090,7 @@ def migrate( If ``auth`` is specified, authenticate to the destination server with the password provided. - For more information see https://redis.io/commands/migrate + For more information, see https://redis.io/commands/migrate """ keys = list_or_args(keys, []) if not keys: @@ -1122,7 +1122,7 @@ def memory_doctor(self, **kwargs) -> None: """ MEMORY DOCTOR is intentionally not implemented in the client. - For more information see https://redis.io/commands/memory-doctor + For more information, see https://redis.io/commands/memory-doctor """ ) @@ -1131,7 +1131,7 @@ def memory_help(self, **kwargs) -> None: """ MEMORY HELP is intentionally not implemented in the client. - For more information see https://redis.io/commands/memory-help + For more information, see https://redis.io/commands/memory-help """ ) @@ -1139,7 +1139,7 @@ def memory_stats(self, **kwargs) -> ResponseT: """ Return a dictionary of memory stats - For more information see https://redis.io/commands/memory-stats + For more information, see https://redis.io/commands/memory-stats """ return self.execute_command("MEMORY STATS", **kwargs) @@ -1162,7 +1162,7 @@ def memory_usage( sample. If left unspecified, the server's default is 5. Use 0 to sample all elements. - For more information see https://redis.io/commands/memory-usage + For more information, see https://redis.io/commands/memory-usage """ args = [] if isinstance(samples, int): @@ -1173,7 +1173,7 @@ def memory_purge(self, **kwargs) -> ResponseT: """ Attempts to purge dirty pages for reclamation by allocator - For more information see https://redis.io/commands/memory-purge + For more information, see https://redis.io/commands/memory-purge """ return self.execute_command("MEMORY PURGE", **kwargs) @@ -1190,7 +1190,7 @@ def latency_history(self, event: str) -> ResponseT: """ Returns the raw data of the ``event``'s latency spikes time series. - For more information see https://redis.io/commands/latency-history + For more information, see https://redis.io/commands/latency-history """ return self.execute_command("LATENCY HISTORY", event) @@ -1198,7 +1198,7 @@ def latency_latest(self) -> ResponseT: """ Reports the latest latency events logged. - For more information see https://redis.io/commands/latency-latest + For more information, see https://redis.io/commands/latency-latest """ return self.execute_command("LATENCY LATEST") @@ -1206,7 +1206,7 @@ def latency_reset(self, *events: str) -> ResponseT: """ Resets the latency spikes time series of all, or only some, events. - For more information see https://redis.io/commands/latency-reset + For more information, see https://redis.io/commands/latency-reset """ return self.execute_command("LATENCY RESET", *events) @@ -1214,7 +1214,7 @@ def ping(self, **kwargs) -> ResponseT: """ Ping the Redis server - For more information see https://redis.io/commands/ping + For more information, see https://redis.io/commands/ping """ return self.execute_command("PING", **kwargs) @@ -1222,7 +1222,7 @@ def quit(self, **kwargs) -> ResponseT: """ Ask the server to close the connection. - For more information see https://redis.io/commands/quit + For more information, see https://redis.io/commands/quit """ return self.execute_command("QUIT", **kwargs) @@ -1235,7 +1235,7 @@ def replicaof(self, *args, **kwargs) -> ResponseT: NO ONE (set no replication) host port (set to the host and port of a redis server) - For more information see https://redis.io/commands/replicaof + For more information, see https://redis.io/commands/replicaof """ return self.execute_command("REPLICAOF", *args, **kwargs) @@ -1244,7 +1244,7 @@ def save(self, **kwargs) -> ResponseT: Tell the Redis server to save its data to disk, blocking until the save is complete - For more information see https://redis.io/commands/save + For more information, see https://redis.io/commands/save """ return self.execute_command("SAVE", **kwargs) @@ -1268,7 +1268,7 @@ def shutdown( ``force`` ignores any errors that would normally prevent the server from exiting ``abort`` cancels an ongoing shutdown and cannot be combined with other flags. - For more information see https://redis.io/commands/shutdown + For more information, see https://redis.io/commands/shutdown """ if save and nosave: raise DataError("SHUTDOWN save and nosave cannot both be set") @@ -1298,7 +1298,7 @@ def slaveof( by the ``host`` and ``port``. If called without arguments, the instance is promoted to a master instead. - For more information see https://redis.io/commands/slaveof + For more information, see https://redis.io/commands/slaveof """ if host is None and port is None: return self.execute_command("SLAVEOF", b"NO", b"ONE", **kwargs) @@ -1309,7 +1309,7 @@ def slowlog_get(self, num: Optional[int] = None, **kwargs) -> ResponseT: Get the entries from the slowlog. If ``num`` is specified, get the most recent ``num`` items. - For more information see https://redis.io/commands/slowlog-get + For more information, see https://redis.io/commands/slowlog-get """ from redis.client import NEVER_DECODE @@ -1325,7 +1325,7 @@ def slowlog_len(self, **kwargs) -> ResponseT: """ Get the number of items in the slowlog - For more information see https://redis.io/commands/slowlog-len + For more information, see https://redis.io/commands/slowlog-len """ return self.execute_command("SLOWLOG LEN", **kwargs) @@ -1333,7 +1333,7 @@ def slowlog_reset(self, **kwargs) -> ResponseT: """ Remove all items in the slowlog - For more information see https://redis.io/commands/slowlog-reset + For more information, see https://redis.io/commands/slowlog-reset """ return self.execute_command("SLOWLOG RESET", **kwargs) @@ -1342,7 +1342,7 @@ def time(self, **kwargs) -> ResponseT: Returns the server time as a 2-item tuple of ints: (seconds since epoch, microseconds into this second). - For more information see https://redis.io/commands/time + For more information, see https://redis.io/commands/time """ return self.execute_command("TIME", **kwargs) @@ -1353,7 +1353,7 @@ def wait(self, num_replicas: int, timeout: int, **kwargs) -> ResponseT: we finally have at least ``num_replicas``, or when the ``timeout`` was reached. - For more information see https://redis.io/commands/wait + For more information, see https://redis.io/commands/wait """ return self.execute_command("WAIT", num_replicas, timeout, **kwargs) @@ -1366,7 +1366,7 @@ def waitaof( to the AOF of the local Redis and/or at least the specified number of replicas. - For more information see https://redis.io/commands/waitaof + For more information, see https://redis.io/commands/waitaof """ return self.execute_command( "WAITAOF", num_local, num_replicas, timeout, **kwargs @@ -1419,7 +1419,7 @@ async def shutdown( configured. If the "nosave" option is set, no data flush will be attempted. The "save" and "nosave" options cannot both be set. - For more information see https://redis.io/commands/shutdown + For more information, see https://redis.io/commands/shutdown """ if save and nosave: raise DataError("SHUTDOWN save and nosave cannot both be set") @@ -1565,7 +1565,7 @@ def append(self, key: KeyT, value: EncodableT) -> ResponseT: doesn't already exist, create it with a value of ``value``. Returns the new length of the value at ``key``. - For more information see https://redis.io/commands/append + For more information, see https://redis.io/commands/append """ return self.execute_command("APPEND", key, value) @@ -1580,7 +1580,7 @@ def bitcount( Returns the count of set bits in the value of ``key``. Optional ``start`` and ``end`` parameters indicate which bytes to consider - For more information see https://redis.io/commands/bitcount + For more information, see https://redis.io/commands/bitcount """ params = [key] if start is not None and end is not None: @@ -1601,7 +1601,7 @@ def bitfield( Return a BitFieldOperation instance to conveniently construct one or more bitfield operations on ``key``. - For more information see https://redis.io/commands/bitfield + For more information, see https://redis.io/commands/bitfield """ return BitFieldOperation(self, key, default_overflow=default_overflow) @@ -1619,7 +1619,7 @@ def bitfield_ro( encoding/offset pairs in optional list ``items`` Read-only variant of the BITFIELD command. - For more information see https://redis.io/commands/bitfield_ro + For more information, see https://redis.io/commands/bitfield_ro """ params = [key, "GET", encoding, offset] @@ -1633,7 +1633,7 @@ def bitop(self, operation: str, dest: KeyT, *keys: KeyT) -> ResponseT: Perform a bitwise operation using ``operation`` between ``keys`` and store the result in ``dest``. - For more information see https://redis.io/commands/bitop + For more information, see https://redis.io/commands/bitop """ return self.execute_command("BITOP", operation, dest, *keys) @@ -1651,7 +1651,7 @@ def bitpos( as a range of bytes and not a range of bits, so start=0 and end=2 means to look at the first three bytes. - For more information see https://redis.io/commands/bitpos + For more information, see https://redis.io/commands/bitpos """ if bit not in (0, 1): raise DataError("bit must be 0 or 1") @@ -1685,7 +1685,7 @@ def copy( copying the value to it. By default, the value is not copied if the ``destination`` key already exists. - For more information see https://redis.io/commands/copy + For more information, see https://redis.io/commands/copy """ params = [source, destination] if destination_db is not None: @@ -1699,7 +1699,7 @@ def decrby(self, name: KeyT, amount: int = 1) -> ResponseT: Decrements the value of ``key`` by ``amount``. If no key exists, the value will be initialized as 0 - ``amount`` - For more information see https://redis.io/commands/decrby + For more information, see https://redis.io/commands/decrby """ return self.execute_command("DECRBY", name, amount) @@ -1719,7 +1719,7 @@ def dump(self, name: KeyT) -> ResponseT: Return a serialized version of the value stored at the specified key. If key does not exist a nil bulk reply is returned. - For more information see https://redis.io/commands/dump + For more information, see https://redis.io/commands/dump """ from redis.client import NEVER_DECODE @@ -1731,7 +1731,7 @@ def exists(self, *names: KeyT) -> ResponseT: """ Returns the number of ``names`` that exist - For more information see https://redis.io/commands/exists + For more information, see https://redis.io/commands/exists """ return self.execute_command("EXISTS", *names, keys=names) @@ -1757,7 +1757,7 @@ def expire( GT -> Set expiry only when the new expiry is greater than current one LT -> Set expiry only when the new expiry is less than current one - For more information see https://redis.io/commands/expire + For more information, see https://redis.io/commands/expire """ if isinstance(time, datetime.timedelta): time = int(time.total_seconds()) @@ -1794,7 +1794,7 @@ def expireat( -> GT -- Set expiry only when the new expiry is greater than current one -> LT -- Set expiry only when the new expiry is less than current one - For more information see https://redis.io/commands/expireat + For more information, see https://redis.io/commands/expireat """ if isinstance(when, datetime.datetime): when = int(when.timestamp()) @@ -1816,7 +1816,7 @@ def expiretime(self, key: str) -> int: Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire. - For more information see https://redis.io/commands/expiretime + For more information, see https://redis.io/commands/expiretime """ return self.execute_command("EXPIRETIME", key) @@ -1824,7 +1824,7 @@ def get(self, name: KeyT) -> ResponseT: """ Return the value at key ``name``, or None if the key doesn't exist - For more information see https://redis.io/commands/get + For more information, see https://redis.io/commands/get """ return self.execute_command("GET", name, keys=[name]) @@ -1835,7 +1835,7 @@ def getdel(self, name: KeyT) -> ResponseT: the key on success (if and only if the key's value type is a string). - For more information see https://redis.io/commands/getdel + For more information, see https://redis.io/commands/getdel """ return self.execute_command("GETDEL", name) @@ -1866,7 +1866,7 @@ def getex( ``persist`` remove the time to live associated with ``name``. - For more information see https://redis.io/commands/getex + For more information, see https://redis.io/commands/getex """ opset = {ex, px, exat, pxat} if len(opset) > 2 or len(opset) > 1 and persist: @@ -1896,7 +1896,7 @@ def getbit(self, name: KeyT, offset: int) -> ResponseT: """ Returns an integer indicating the value of ``offset`` in ``name`` - For more information see https://redis.io/commands/getbit + For more information, see https://redis.io/commands/getbit """ return self.execute_command("GETBIT", name, offset, keys=[name]) @@ -1905,7 +1905,7 @@ def getrange(self, key: KeyT, start: int, end: int) -> ResponseT: Returns the substring of the string value stored at ``key``, determined by the offsets ``start`` and ``end`` (both are inclusive) - For more information see https://redis.io/commands/getrange + For more information, see https://redis.io/commands/getrange """ return self.execute_command("GETRANGE", key, start, end, keys=[key]) @@ -1917,7 +1917,7 @@ def getset(self, name: KeyT, value: EncodableT) -> ResponseT: As per Redis 6.2, GETSET is considered deprecated. Please use SET with GET parameter in new code. - For more information see https://redis.io/commands/getset + For more information, see https://redis.io/commands/getset """ return self.execute_command("GETSET", name, value) @@ -1926,7 +1926,7 @@ def incrby(self, name: KeyT, amount: int = 1) -> ResponseT: Increments the value of ``key`` by ``amount``. If no key exists, the value will be initialized as ``amount`` - For more information see https://redis.io/commands/incrby + For more information, see https://redis.io/commands/incrby """ return self.execute_command("INCRBY", name, amount) @@ -1937,7 +1937,7 @@ def incrbyfloat(self, name: KeyT, amount: float = 1.0) -> ResponseT: Increments the value at key ``name`` by floating ``amount``. If no key exists, the value will be initialized as ``amount`` - For more information see https://redis.io/commands/incrbyfloat + For more information, see https://redis.io/commands/incrbyfloat """ return self.execute_command("INCRBYFLOAT", name, amount) @@ -1945,7 +1945,7 @@ def keys(self, pattern: PatternT = "*", **kwargs) -> ResponseT: """ Returns a list of keys matching ``pattern`` - For more information see https://redis.io/commands/keys + For more information, see https://redis.io/commands/keys """ return self.execute_command("KEYS", pattern, **kwargs) @@ -1957,7 +1957,7 @@ def lmove( pushing it as the first/last element on the destination list. Returns the element being popped and pushed. - For more information see https://redis.io/commands/lmove + For more information, see https://redis.io/commands/lmove """ params = [first_list, second_list, src, dest] return self.execute_command("LMOVE", *params) @@ -1973,7 +1973,7 @@ def blmove( """ Blocking version of lmove. - For more information see https://redis.io/commands/blmove + For more information, see https://redis.io/commands/blmove """ params = [first_list, second_list, src, dest, timeout] return self.execute_command("BLMOVE", *params) @@ -1982,7 +1982,7 @@ def mget(self, keys: KeysT, *args: EncodableT) -> ResponseT: """ Returns a list of values ordered identically to ``keys`` - For more information see https://redis.io/commands/mget + For more information, see https://redis.io/commands/mget """ from redis.client import EMPTY_RESPONSE @@ -1999,7 +1999,7 @@ def mset(self, mapping: Mapping[AnyKeyT, EncodableT]) -> ResponseT: key/value pairs. Both keys and values should be strings or types that can be cast to a string via str(). - For more information see https://redis.io/commands/mset + For more information, see https://redis.io/commands/mset """ items = [] for pair in mapping.items(): @@ -2013,7 +2013,7 @@ def msetnx(self, mapping: Mapping[AnyKeyT, EncodableT]) -> ResponseT: should be strings or types that can be cast to a string via str(). Returns a boolean indicating if the operation was successful. - For more information see https://redis.io/commands/msetnx + For more information, see https://redis.io/commands/msetnx """ items = [] for pair in mapping.items(): @@ -2024,7 +2024,7 @@ def move(self, name: KeyT, db: int) -> ResponseT: """ Moves the key ``name`` to a different Redis database ``db`` - For more information see https://redis.io/commands/move + For more information, see https://redis.io/commands/move """ return self.execute_command("MOVE", name, db) @@ -2032,7 +2032,7 @@ def persist(self, name: KeyT) -> ResponseT: """ Removes an expiration on ``name`` - For more information see https://redis.io/commands/persist + For more information, see https://redis.io/commands/persist """ return self.execute_command("PERSIST", name) @@ -2056,7 +2056,7 @@ def pexpire( GT -> Set expiry only when the new expiry is greater than current one LT -> Set expiry only when the new expiry is less than current one - For more information see https://redis.io/commands/pexpire + For more information, see https://redis.io/commands/pexpire """ if isinstance(time, datetime.timedelta): time = int(time.total_seconds() * 1000) @@ -2092,7 +2092,7 @@ def pexpireat( GT -> Set expiry only when the new expiry is greater than current one LT -> Set expiry only when the new expiry is less than current one - For more information see https://redis.io/commands/pexpireat + For more information, see https://redis.io/commands/pexpireat """ if isinstance(when, datetime.datetime): when = int(when.timestamp() * 1000) @@ -2112,7 +2112,7 @@ def pexpiretime(self, key: str) -> int: Returns the absolute Unix timestamp (since January 1, 1970) in milliseconds at which the given key will expire. - For more information see https://redis.io/commands/pexpiretime + For more information, see https://redis.io/commands/pexpiretime """ return self.execute_command("PEXPIRETIME", key) @@ -2122,7 +2122,7 @@ def psetex(self, name: KeyT, time_ms: ExpiryT, value: EncodableT): milliseconds. ``time_ms`` can be represented by an integer or a Python timedelta object - For more information see https://redis.io/commands/psetex + For more information, see https://redis.io/commands/psetex """ if isinstance(time_ms, datetime.timedelta): time_ms = int(time_ms.total_seconds() * 1000) @@ -2132,7 +2132,7 @@ def pttl(self, name: KeyT) -> ResponseT: """ Returns the number of milliseconds until the key ``name`` will expire - For more information see https://redis.io/commands/pttl + For more information, see https://redis.io/commands/pttl """ return self.execute_command("PTTL", name) @@ -2150,7 +2150,7 @@ def hrandfield( withvalues: The optional WITHVALUES modifier changes the reply so it includes the respective values of the randomly selected hash fields. - For more information see https://redis.io/commands/hrandfield + For more information, see https://redis.io/commands/hrandfield """ params = [] if count is not None: @@ -2164,7 +2164,7 @@ def randomkey(self, **kwargs) -> ResponseT: """ Returns the name of a random key - For more information see https://redis.io/commands/randomkey + For more information, see https://redis.io/commands/randomkey """ return self.execute_command("RANDOMKEY", **kwargs) @@ -2172,7 +2172,7 @@ def rename(self, src: KeyT, dst: KeyT) -> ResponseT: """ Rename key ``src`` to ``dst`` - For more information see https://redis.io/commands/rename + For more information, see https://redis.io/commands/rename """ return self.execute_command("RENAME", src, dst) @@ -2180,7 +2180,7 @@ def renamenx(self, src: KeyT, dst: KeyT): """ Rename key ``src`` to ``dst`` if ``dst`` doesn't already exist - For more information see https://redis.io/commands/renamenx + For more information, see https://redis.io/commands/renamenx """ return self.execute_command("RENAMENX", src, dst) @@ -2211,7 +2211,7 @@ def restore( ``frequency`` Used for eviction, this is the frequency counter of the object stored at the key, prior to execution. - For more information see https://redis.io/commands/restore + For more information, see https://redis.io/commands/restore """ params = [name, ttl, value] if replace: @@ -2273,7 +2273,7 @@ def set( ``pxat`` sets an expire flag on key ``name`` for ``ex`` milliseconds, specified in unix time. - For more information see https://redis.io/commands/set + For more information, see https://redis.io/commands/set """ opset = {ex, px, exat, pxat} if len(opset) > 2 or len(opset) > 1 and keepttl: @@ -2312,7 +2312,7 @@ def setbit(self, name: KeyT, offset: int, value: int) -> ResponseT: Flag the ``offset`` in ``name`` as ``value``. Returns an integer indicating the previous value of ``offset``. - For more information see https://redis.io/commands/setbit + For more information, see https://redis.io/commands/setbit """ value = value and 1 or 0 return self.execute_command("SETBIT", name, offset, value) @@ -2323,7 +2323,7 @@ def setex(self, name: KeyT, time: ExpiryT, value: EncodableT) -> ResponseT: seconds. ``time`` can be represented by an integer or a Python timedelta object. - For more information see https://redis.io/commands/setex + For more information, see https://redis.io/commands/setex """ if isinstance(time, datetime.timedelta): time = int(time.total_seconds()) @@ -2333,7 +2333,7 @@ def setnx(self, name: KeyT, value: EncodableT) -> ResponseT: """ Set the value of key ``name`` to ``value`` if key doesn't exist - For more information see https://redis.io/commands/setnx + For more information, see https://redis.io/commands/setnx """ return self.execute_command("SETNX", name, value) @@ -2348,7 +2348,7 @@ def setrange(self, name: KeyT, offset: int, value: EncodableT) -> ResponseT: Returns the length of the new string. - For more information see https://redis.io/commands/setrange + For more information, see https://redis.io/commands/setrange """ return self.execute_command("SETRANGE", name, offset, value) @@ -2381,7 +2381,7 @@ def stralgo( ``withmatchlen`` Returns the matches with the len of the match. Can be provided only when ``idx`` set to True. - For more information see https://redis.io/commands/stralgo + For more information, see https://redis.io/commands/stralgo """ # check validity supported_algo = ["LCS"] @@ -2420,7 +2420,7 @@ def strlen(self, name: KeyT) -> ResponseT: """ Return the number of bytes stored in the value of ``name`` - For more information see https://redis.io/commands/strlen + For more information, see https://redis.io/commands/strlen """ return self.execute_command("STRLEN", name, keys=[name]) @@ -2436,7 +2436,7 @@ def touch(self, *args: KeyT) -> ResponseT: Alters the last access time of a key(s) ``*args``. A key is ignored if it does not exist. - For more information see https://redis.io/commands/touch + For more information, see https://redis.io/commands/touch """ return self.execute_command("TOUCH", *args) @@ -2444,7 +2444,7 @@ def ttl(self, name: KeyT) -> ResponseT: """ Returns the number of seconds until the key ``name`` will expire - For more information see https://redis.io/commands/ttl + For more information, see https://redis.io/commands/ttl """ return self.execute_command("TTL", name) @@ -2452,7 +2452,7 @@ def type(self, name: KeyT) -> ResponseT: """ Returns the type of key ``name`` - For more information see https://redis.io/commands/type + For more information, see https://redis.io/commands/type """ return self.execute_command("TYPE", name, keys=[name]) @@ -2460,7 +2460,7 @@ def watch(self, *names: KeyT) -> None: """ Watches the values at keys ``names``, or None if the key doesn't exist - For more information see https://redis.io/commands/watch + For more information, see https://redis.io/commands/watch """ warnings.warn(DeprecationWarning("Call WATCH from a Pipeline object")) @@ -2468,7 +2468,7 @@ def unwatch(self) -> None: """ Unwatches all previously watched keys for a transaction - For more information see https://redis.io/commands/unwatch + For more information, see https://redis.io/commands/unwatch """ warnings.warn(DeprecationWarning("Call UNWATCH from a Pipeline object")) @@ -2476,7 +2476,7 @@ def unlink(self, *names: KeyT) -> ResponseT: """ Unlink one or more keys specified by ``names`` - For more information see https://redis.io/commands/unlink + For more information, see https://redis.io/commands/unlink """ return self.execute_command("UNLINK", *names) @@ -2496,7 +2496,7 @@ def lcs( ``minmatchlen`` restrict the list of matches to the ones of the given ``minmatchlen``. If ``withmatchlen`` the length of the match also will be returned. - For more information see https://redis.io/commands/lcs + For more information, see https://redis.io/commands/lcs """ pieces = [key1, key2] if len: @@ -2549,7 +2549,7 @@ def blpop( If timeout is 0, then block indefinitely. - For more information see https://redis.io/commands/blpop + For more information, see https://redis.io/commands/blpop """ if timeout is None: timeout = 0 @@ -2570,7 +2570,7 @@ def brpop( If timeout is 0, then block indefinitely. - For more information see https://redis.io/commands/brpop + For more information, see https://redis.io/commands/brpop """ if timeout is None: timeout = 0 @@ -2589,7 +2589,7 @@ def brpoplpush( seconds elapse, whichever is first. A ``timeout`` value of 0 blocks forever. - For more information see https://redis.io/commands/brpoplpush + For more information, see https://redis.io/commands/brpoplpush """ if timeout is None: timeout = 0 @@ -2610,7 +2610,7 @@ def blmpop( When all lists are empty this command blocks the connection until another client pushes to it or until the timeout, timeout of 0 blocks indefinitely - For more information see https://redis.io/commands/blmpop + For more information, see https://redis.io/commands/blmpop """ args = [timeout, numkeys, *args, direction, "COUNT", count] @@ -2627,7 +2627,7 @@ def lmpop( Pop ``count`` values (default 1) first non-empty list key from the list of args provided key names. - For more information see https://redis.io/commands/lmpop + For more information, see https://redis.io/commands/lmpop """ args = [num_keys] + list(args) + [direction] if count != 1: @@ -2644,7 +2644,7 @@ def lindex( Negative indexes are supported and will return an item at the end of the list - For more information see https://redis.io/commands/lindex + For more information, see https://redis.io/commands/lindex """ return self.execute_command("LINDEX", name, index, keys=[name]) @@ -2658,7 +2658,7 @@ def linsert( Returns the new length of the list on success or -1 if ``refvalue`` is not in the list. - For more information see https://redis.io/commands/linsert + For more information, see https://redis.io/commands/linsert """ return self.execute_command("LINSERT", name, where, refvalue, value) @@ -2666,7 +2666,7 @@ def llen(self, name: str) -> Union[Awaitable[int], int]: """ Return the length of the list ``name`` - For more information see https://redis.io/commands/llen + For more information, see https://redis.io/commands/llen """ return self.execute_command("LLEN", name, keys=[name]) @@ -2682,7 +2682,7 @@ def lpop( the list. When provided with the optional ``count`` argument, the reply will consist of up to count elements, depending on the list's length. - For more information see https://redis.io/commands/lpop + For more information, see https://redis.io/commands/lpop """ if count is not None: return self.execute_command("LPOP", name, count) @@ -2693,7 +2693,7 @@ def lpush(self, name: str, *values: FieldT) -> Union[Awaitable[int], int]: """ Push ``values`` onto the head of the list ``name`` - For more information see https://redis.io/commands/lpush + For more information, see https://redis.io/commands/lpush """ return self.execute_command("LPUSH", name, *values) @@ -2701,7 +2701,7 @@ def lpushx(self, name: str, *values: FieldT) -> Union[Awaitable[int], int]: """ Push ``value`` onto the head of the list ``name`` if ``name`` exists - For more information see https://redis.io/commands/lpushx + For more information, see https://redis.io/commands/lpushx """ return self.execute_command("LPUSHX", name, *values) @@ -2713,7 +2713,7 @@ def lrange(self, name: str, start: int, end: int) -> Union[Awaitable[list], list ``start`` and ``end`` can be negative numbers just like Python slicing notation - For more information see https://redis.io/commands/lrange + For more information, see https://redis.io/commands/lrange """ return self.execute_command("LRANGE", name, start, end, keys=[name]) @@ -2727,7 +2727,7 @@ def lrem(self, name: str, count: int, value: str) -> Union[Awaitable[int], int]: count < 0: Remove elements equal to value moving from tail to head. count = 0: Remove all elements equal to value. - For more information see https://redis.io/commands/lrem + For more information, see https://redis.io/commands/lrem """ return self.execute_command("LREM", name, count, value) @@ -2735,7 +2735,7 @@ def lset(self, name: str, index: int, value: str) -> Union[Awaitable[str], str]: """ Set element at ``index`` of list ``name`` to ``value`` - For more information see https://redis.io/commands/lset + For more information, see https://redis.io/commands/lset """ return self.execute_command("LSET", name, index, value) @@ -2747,7 +2747,7 @@ def ltrim(self, name: str, start: int, end: int) -> Union[Awaitable[str], str]: ``start`` and ``end`` can be negative numbers just like Python slicing notation - For more information see https://redis.io/commands/ltrim + For more information, see https://redis.io/commands/ltrim """ return self.execute_command("LTRIM", name, start, end) @@ -2763,7 +2763,7 @@ def rpop( When provided with the optional ``count`` argument, the reply will consist of up to count elements, depending on the list's length. - For more information see https://redis.io/commands/rpop + For more information, see https://redis.io/commands/rpop """ if count is not None: return self.execute_command("RPOP", name, count) @@ -2775,7 +2775,7 @@ def rpoplpush(self, src: str, dst: str) -> Union[Awaitable[str], str]: RPOP a value off of the ``src`` list and atomically LPUSH it on to the ``dst`` list. Returns the value. - For more information see https://redis.io/commands/rpoplpush + For more information, see https://redis.io/commands/rpoplpush """ return self.execute_command("RPOPLPUSH", src, dst) @@ -2783,7 +2783,7 @@ def rpush(self, name: str, *values: FieldT) -> Union[Awaitable[int], int]: """ Push ``values`` onto the tail of the list ``name`` - For more information see https://redis.io/commands/rpush + For more information, see https://redis.io/commands/rpush """ return self.execute_command("RPUSH", name, *values) @@ -2791,7 +2791,7 @@ def rpushx(self, name: str, *values: str) -> Union[Awaitable[int], int]: """ Push ``value`` onto the tail of the list ``name`` if ``name`` exists - For more information see https://redis.io/commands/rpushx + For more information, see https://redis.io/commands/rpushx """ return self.execute_command("RPUSHX", name, *values) @@ -2826,7 +2826,7 @@ def lpos( position(s) of items within the first 1000 entries in the list. A ``maxlen`` of 0 (the default) will scan the entire list. - For more information see https://redis.io/commands/lpos + For more information, see https://redis.io/commands/lpos """ pieces: list[EncodableT] = [name, value] if rank is not None: @@ -2875,7 +2875,7 @@ def sort( elements, sort will return a list of tuples, each containing the values fetched from the arguments to ``get``. - For more information see https://redis.io/commands/sort + For more information, see https://redis.io/commands/sort """ if (start is not None and num is None) or (num is not None and start is None): raise DataError("``start`` and ``num`` must both be specified") @@ -2940,7 +2940,7 @@ def sort_ro( ``alpha`` allows for sorting lexicographically rather than numerically - For more information see https://redis.io/commands/sort_ro + For more information, see https://redis.io/commands/sort_ro """ return self.sort( key, start=start, num=num, by=by, get=get, desc=desc, alpha=alpha @@ -2978,7 +2978,7 @@ def scan( HASH, LIST, SET, STREAM, STRING, ZSET Additionally, Redis modules can expose other types as well. - For more information see https://redis.io/commands/scan + For more information, see https://redis.io/commands/scan """ pieces: list[EncodableT] = [cursor] if match is not None: @@ -3032,7 +3032,7 @@ def sscan( ``count`` allows for hint the minimum number of returns - For more information see https://redis.io/commands/sscan + For more information, see https://redis.io/commands/sscan """ pieces: list[EncodableT] = [name, cursor] if match is not None: @@ -3078,7 +3078,7 @@ def hscan( ``no_values`` indicates to return only the keys, without values. - For more information see https://redis.io/commands/hscan + For more information, see https://redis.io/commands/hscan """ pieces: list[EncodableT] = [name, cursor] if match is not None: @@ -3134,7 +3134,7 @@ def zscan( ``score_cast_func`` a callable used to cast the score return value - For more information see https://redis.io/commands/zscan + For more information, see https://redis.io/commands/zscan """ pieces = [name, cursor] if match is not None: @@ -3294,7 +3294,7 @@ def sadd(self, name: KeyT, *values: FieldT) -> Union[Awaitable[int], int]: """ Add ``value(s)`` to set ``name`` - For more information see https://redis.io/commands/sadd + For more information, see https://redis.io/commands/sadd """ return self.execute_command("SADD", name, *values) @@ -3302,7 +3302,7 @@ def scard(self, name: KeyT) -> Union[Awaitable[int], int]: """ Return the number of elements in set ``name`` - For more information see https://redis.io/commands/scard + For more information, see https://redis.io/commands/scard """ return self.execute_command("SCARD", name, keys=[name]) @@ -3310,7 +3310,7 @@ def sdiff(self, keys: List, *args: List) -> Union[Awaitable[list], list]: """ Return the difference of sets specified by ``keys`` - For more information see https://redis.io/commands/sdiff + For more information, see https://redis.io/commands/sdiff """ args = list_or_args(keys, args) return self.execute_command("SDIFF", *args, keys=args) @@ -3322,7 +3322,7 @@ def sdiffstore( Store the difference of sets specified by ``keys`` into a new set named ``dest``. Returns the number of keys in the new set. - For more information see https://redis.io/commands/sdiffstore + For more information, see https://redis.io/commands/sdiffstore """ args = list_or_args(keys, args) return self.execute_command("SDIFFSTORE", dest, *args) @@ -3331,7 +3331,7 @@ def sinter(self, keys: List, *args: List) -> Union[Awaitable[list], list]: """ Return the intersection of sets specified by ``keys`` - For more information see https://redis.io/commands/sinter + For more information, see https://redis.io/commands/sinter """ args = list_or_args(keys, args) return self.execute_command("SINTER", *args, keys=args) @@ -3346,7 +3346,7 @@ def sintercard( cardinality reaches limit partway through the computation, the algorithm will exit and yield limit as the cardinality - For more information see https://redis.io/commands/sintercard + For more information, see https://redis.io/commands/sintercard """ args = [numkeys, *keys, "LIMIT", limit] return self.execute_command("SINTERCARD", *args, keys=keys) @@ -3358,7 +3358,7 @@ def sinterstore( Store the intersection of sets specified by ``keys`` into a new set named ``dest``. Returns the number of keys in the new set. - For more information see https://redis.io/commands/sinterstore + For more information, see https://redis.io/commands/sinterstore """ args = list_or_args(keys, args) return self.execute_command("SINTERSTORE", dest, *args) @@ -3371,7 +3371,7 @@ def sismember( - 1 if the value is a member of the set. - 0 if the value is not a member of the set or if key does not exist. - For more information see https://redis.io/commands/sismember + For more information, see https://redis.io/commands/sismember """ return self.execute_command("SISMEMBER", name, value, keys=[name]) @@ -3379,7 +3379,7 @@ def smembers(self, name: KeyT) -> Union[Awaitable[Set], Set]: """ Return all members of the set ``name`` - For more information see https://redis.io/commands/smembers + For more information, see https://redis.io/commands/smembers """ return self.execute_command("SMEMBERS", name, keys=[name]) @@ -3395,7 +3395,7 @@ def smismember( - 1 if the value is a member of the set. - 0 if the value is not a member of the set or if key does not exist. - For more information see https://redis.io/commands/smismember + For more information, see https://redis.io/commands/smismember """ args = list_or_args(values, args) return self.execute_command("SMISMEMBER", name, *args, keys=[name]) @@ -3404,7 +3404,7 @@ def smove(self, src: KeyT, dst: KeyT, value: str) -> Union[Awaitable[bool], bool """ Move ``value`` from set ``src`` to set ``dst`` atomically - For more information see https://redis.io/commands/smove + For more information, see https://redis.io/commands/smove """ return self.execute_command("SMOVE", src, dst, value) @@ -3412,7 +3412,7 @@ def spop(self, name: KeyT, count: Optional[int] = None) -> Union[str, List, None """ Remove and return a random member of set ``name`` - For more information see https://redis.io/commands/spop + For more information, see https://redis.io/commands/spop """ args = (count is not None) and [count] or [] return self.execute_command("SPOP", name, *args) @@ -3427,7 +3427,7 @@ def srandmember( members of set ``name``. Note this is only available when running Redis 2.6+. - For more information see https://redis.io/commands/srandmember + For more information, see https://redis.io/commands/srandmember """ args = (number is not None) and [number] or [] return self.execute_command("SRANDMEMBER", name, *args) @@ -3436,7 +3436,7 @@ def srem(self, name: KeyT, *values: FieldT) -> Union[Awaitable[int], int]: """ Remove ``values`` from set ``name`` - For more information see https://redis.io/commands/srem + For more information, see https://redis.io/commands/srem """ return self.execute_command("SREM", name, *values) @@ -3444,7 +3444,7 @@ def sunion(self, keys: List, *args: List) -> Union[Awaitable[List], List]: """ Return the union of sets specified by ``keys`` - For more information see https://redis.io/commands/sunion + For more information, see https://redis.io/commands/sunion """ args = list_or_args(keys, args) return self.execute_command("SUNION", *args, keys=args) @@ -3456,7 +3456,7 @@ def sunionstore( Store the union of sets specified by ``keys`` into a new set named ``dest``. Returns the number of keys in the new set. - For more information see https://redis.io/commands/sunionstore + For more information, see https://redis.io/commands/sunionstore """ args = list_or_args(keys, args) return self.execute_command("SUNIONSTORE", dest, *args) @@ -3480,7 +3480,7 @@ def xack(self, name: KeyT, groupname: GroupT, *ids: StreamIdT) -> ResponseT: groupname: name of the consumer group. *ids: message ids to acknowledge. - For more information see https://redis.io/commands/xack + For more information, see https://redis.io/commands/xack """ return self.execute_command("XACK", name, groupname, *ids) @@ -3535,7 +3535,7 @@ def xadd( - DELREF: When trimming, removes all references from consumer groups' PEL - ACKED: When trimming, only removes entries acknowledged by all consumer groups - For more information see https://redis.io/commands/xadd + For more information, see https://redis.io/commands/xadd """ pieces: list[EncodableT] = [] if maxlen is not None and minid is not None: @@ -3595,7 +3595,7 @@ def xautoclaim( justid: optional boolean, false by default. Return just an array of IDs of messages successfully claimed, without returning the actual message - For more information see https://redis.io/commands/xautoclaim + For more information, see https://redis.io/commands/xautoclaim """ try: if int(min_idle_time) < 0: @@ -3665,7 +3665,7 @@ def xclaim( justid: optional boolean, false by default. Return just an array of IDs of messages successfully claimed, without returning the actual message - For more information see https://redis.io/commands/xclaim + For more information, see https://redis.io/commands/xclaim """ if not isinstance(min_idle_time, int) or min_idle_time < 0: raise DataError("XCLAIM min_idle_time must be a non negative integer") @@ -3711,7 +3711,7 @@ def xdel(self, name: KeyT, *ids: StreamIdT) -> ResponseT: name: name of the stream. *ids: message ids to delete. - For more information see https://redis.io/commands/xdel + For more information, see https://redis.io/commands/xdel """ return self.execute_command("XDEL", name, *ids) @@ -3749,7 +3749,7 @@ def xgroup_create( groupname: name of the consumer group. id: ID of the last item in the stream to consider already delivered. - For more information see https://redis.io/commands/xgroup-create + For more information, see https://redis.io/commands/xgroup-create """ pieces: list[EncodableT] = ["XGROUP CREATE", name, groupname, id] if mkstream: @@ -3770,7 +3770,7 @@ def xgroup_delconsumer( groupname: name of the consumer group. consumername: name of consumer to delete - For more information see https://redis.io/commands/xgroup-delconsumer + For more information, see https://redis.io/commands/xgroup-delconsumer """ return self.execute_command("XGROUP DELCONSUMER", name, groupname, consumername) @@ -3780,7 +3780,7 @@ def xgroup_destroy(self, name: KeyT, groupname: GroupT) -> ResponseT: name: name of the stream. groupname: name of the consumer group. - For more information see https://redis.io/commands/xgroup-destroy + For more information, see https://redis.io/commands/xgroup-destroy """ return self.execute_command("XGROUP DESTROY", name, groupname) @@ -3814,7 +3814,7 @@ def xgroup_setid( groupname: name of the consumer group. id: ID of the last item in the stream to consider already delivered. - For more information see https://redis.io/commands/xgroup-setid + For more information, see https://redis.io/commands/xgroup-setid """ pieces = [name, groupname, id] if entries_read is not None: @@ -3827,7 +3827,7 @@ def xinfo_consumers(self, name: KeyT, groupname: GroupT) -> ResponseT: name: name of the stream. groupname: name of the consumer group. - For more information see https://redis.io/commands/xinfo-consumers + For more information, see https://redis.io/commands/xinfo-consumers """ return self.execute_command("XINFO CONSUMERS", name, groupname) @@ -3836,7 +3836,7 @@ def xinfo_groups(self, name: KeyT) -> ResponseT: Returns general information about the consumer groups of the stream. name: name of the stream. - For more information see https://redis.io/commands/xinfo-groups + For more information, see https://redis.io/commands/xinfo-groups """ return self.execute_command("XINFO GROUPS", name) @@ -3846,7 +3846,7 @@ def xinfo_stream(self, name: KeyT, full: bool = False) -> ResponseT: name: name of the stream. full: optional boolean, false by default. Return full summary - For more information see https://redis.io/commands/xinfo-stream + For more information, see https://redis.io/commands/xinfo-stream """ pieces = [name] options = {} @@ -3859,7 +3859,7 @@ def xlen(self, name: KeyT) -> ResponseT: """ Returns the number of elements in a given stream. - For more information see https://redis.io/commands/xlen + For more information, see https://redis.io/commands/xlen """ return self.execute_command("XLEN", name, keys=[name]) @@ -3869,7 +3869,7 @@ def xpending(self, name: KeyT, groupname: GroupT) -> ResponseT: name: name of the stream. groupname: name of the consumer group. - For more information see https://redis.io/commands/xpending + For more information, see https://redis.io/commands/xpending """ return self.execute_command("XPENDING", name, groupname, keys=[name]) @@ -3951,7 +3951,7 @@ def xrange( count: if set, only return this many items, beginning with the earliest available. - For more information see https://redis.io/commands/xrange + For more information, see https://redis.io/commands/xrange """ pieces = [min, max] if count is not None: @@ -3979,7 +3979,7 @@ def xread( block: number of milliseconds to wait, if nothing already present. - For more information see https://redis.io/commands/xread + For more information, see https://redis.io/commands/xread """ pieces = [] if block is not None: @@ -4025,7 +4025,7 @@ def xreadgroup( block: number of milliseconds to wait, if nothing already present. noack: do not add messages to the PEL - For more information see https://redis.io/commands/xreadgroup + For more information, see https://redis.io/commands/xreadgroup """ pieces: list[EncodableT] = [b"GROUP", groupname, consumername] if count is not None: @@ -4068,7 +4068,7 @@ def xrevrange( count: if set, only return this many items, beginning with the latest available. - For more information see https://redis.io/commands/xrevrange + For more information, see https://redis.io/commands/xrevrange """ pieces: list[EncodableT] = [max, min] if count is not None: @@ -4102,7 +4102,7 @@ def xtrim( - DELREF: Trims entries and removes all references from consumer groups' PEL - ACKED: Only trims entries that were read and acknowledged by all consumer groups - For more information see https://redis.io/commands/xtrim + For more information, see https://redis.io/commands/xtrim """ pieces: list[EncodableT] = [] if maxlen is not None and minid is not None: @@ -4223,7 +4223,7 @@ def zcard(self, name: KeyT) -> ResponseT: """ Return the number of elements in the sorted set ``name`` - For more information see https://redis.io/commands/zcard + For more information, see https://redis.io/commands/zcard """ return self.execute_command("ZCARD", name, keys=[name]) @@ -4232,7 +4232,7 @@ def zcount(self, name: KeyT, min: ZScoreBoundT, max: ZScoreBoundT) -> ResponseT: Returns the number of elements in the sorted set at key ``name`` with a score between ``min`` and ``max``. - For more information see https://redis.io/commands/zcount + For more information, see https://redis.io/commands/zcount """ return self.execute_command("ZCOUNT", name, min, max, keys=[name]) @@ -4241,7 +4241,7 @@ def zdiff(self, keys: KeysT, withscores: bool = False) -> ResponseT: Returns the difference between the first and all successive input sorted sets provided in ``keys``. - For more information see https://redis.io/commands/zdiff + For more information, see https://redis.io/commands/zdiff """ pieces = [len(keys), *keys] if withscores: @@ -4253,7 +4253,7 @@ def zdiffstore(self, dest: KeyT, keys: KeysT) -> ResponseT: Computes the difference between the first and all successive input sorted sets provided in ``keys`` and stores the result in ``dest``. - For more information see https://redis.io/commands/zdiffstore + For more information, see https://redis.io/commands/zdiffstore """ pieces = [len(keys), *keys] return self.execute_command("ZDIFFSTORE", dest, *pieces) @@ -4262,7 +4262,7 @@ def zincrby(self, name: KeyT, amount: float, value: EncodableT) -> ResponseT: """ Increment the score of ``value`` in sorted set ``name`` by ``amount`` - For more information see https://redis.io/commands/zincrby + For more information, see https://redis.io/commands/zincrby """ return self.execute_command("ZINCRBY", name, amount, value) @@ -4278,7 +4278,7 @@ def zinter( set will contain the minimum or maximum score of an element across the inputs where it exists. - For more information see https://redis.io/commands/zinter + For more information, see https://redis.io/commands/zinter """ return self._zaggregate("ZINTER", None, keys, aggregate, withscores=withscores) @@ -4297,7 +4297,7 @@ def zinterstore( contain the minimum or maximum score of an element across the inputs where it exists. - For more information see https://redis.io/commands/zinterstore + For more information, see https://redis.io/commands/zinterstore """ return self._zaggregate("ZINTERSTORE", dest, keys, aggregate) @@ -4311,7 +4311,7 @@ def zintercard( cardinality reaches limit partway through the computation, the algorithm will exit and yield limit as the cardinality - For more information see https://redis.io/commands/zintercard + For more information, see https://redis.io/commands/zintercard """ args = [numkeys, *keys, "LIMIT", limit] return self.execute_command("ZINTERCARD", *args, keys=keys) @@ -4321,7 +4321,7 @@ def zlexcount(self, name, min, max): Return the number of items in the sorted set ``name`` between the lexicographical range ``min`` and ``max``. - For more information see https://redis.io/commands/zlexcount + For more information, see https://redis.io/commands/zlexcount """ return self.execute_command("ZLEXCOUNT", name, min, max, keys=[name]) @@ -4330,7 +4330,7 @@ def zpopmax(self, name: KeyT, count: Optional[int] = None) -> ResponseT: Remove and return up to ``count`` members with the highest scores from the sorted set ``name``. - For more information see https://redis.io/commands/zpopmax + For more information, see https://redis.io/commands/zpopmax """ args = (count is not None) and [count] or [] options = {"withscores": True} @@ -4341,7 +4341,7 @@ def zpopmin(self, name: KeyT, count: Optional[int] = None) -> ResponseT: Remove and return up to ``count`` members with the lowest scores from the sorted set ``name``. - For more information see https://redis.io/commands/zpopmin + For more information, see https://redis.io/commands/zpopmin """ args = (count is not None) and [count] or [] options = {"withscores": True} @@ -4363,7 +4363,7 @@ def zrandmember( includes the respective scores of the randomly selected elements from the sorted set. - For more information see https://redis.io/commands/zrandmember + For more information, see https://redis.io/commands/zrandmember """ params = [] if count is not None: @@ -4384,7 +4384,7 @@ def bzpopmax(self, keys: KeysT, timeout: TimeoutSecT = 0) -> ResponseT: If timeout is 0, then block indefinitely. - For more information see https://redis.io/commands/bzpopmax + For more information, see https://redis.io/commands/bzpopmax """ if timeout is None: timeout = 0 @@ -4403,7 +4403,7 @@ def bzpopmin(self, keys: KeysT, timeout: TimeoutSecT = 0) -> ResponseT: If timeout is 0, then block indefinitely. - For more information see https://redis.io/commands/bzpopmin + For more information, see https://redis.io/commands/bzpopmin """ if timeout is None: timeout = 0 @@ -4422,7 +4422,7 @@ def zmpop( """ Pop ``count`` values (default 1) off of the first non-empty sorted set named in the ``keys`` list. - For more information see https://redis.io/commands/zmpop + For more information, see https://redis.io/commands/zmpop """ args = [num_keys] + keys if (min and max) or (not min and not max): @@ -4455,7 +4455,7 @@ def bzmpop( If timeout is 0, then block indefinitely. - For more information see https://redis.io/commands/bzmpop + For more information, see https://redis.io/commands/bzmpop """ args = [timeout, numkeys, *keys] if (min and max) or (not min and not max): @@ -4548,7 +4548,7 @@ def zrange( ``offset`` and ``num`` are specified, then return a slice of the range. Can't be provided when using ``bylex``. - For more information see https://redis.io/commands/zrange + For more information, see https://redis.io/commands/zrange """ # Need to support ``desc`` also when using old redis version # because it was supported in 3.5.3 (of redis-py) @@ -4589,7 +4589,7 @@ def zrevrange( ``score_cast_func`` a callable used to cast the score return value - For more information see https://redis.io/commands/zrevrange + For more information, see https://redis.io/commands/zrevrange """ pieces = ["ZREVRANGE", name, start, end] if withscores: @@ -4631,7 +4631,7 @@ def zrangestore( ``offset`` and ``num`` are specified, then return a slice of the range. Can't be provided when using ``bylex``. - For more information see https://redis.io/commands/zrangestore + For more information, see https://redis.io/commands/zrangestore """ return self._zrange( "ZRANGESTORE", @@ -4663,7 +4663,7 @@ def zrangebylex( If ``start`` and ``num`` are specified, then return a slice of the range. - For more information see https://redis.io/commands/zrangebylex + For more information, see https://redis.io/commands/zrangebylex """ if (start is not None and num is None) or (num is not None and start is None): raise DataError("``start`` and ``num`` must both be specified") @@ -4687,7 +4687,7 @@ def zrevrangebylex( If ``start`` and ``num`` are specified, then return a slice of the range. - For more information see https://redis.io/commands/zrevrangebylex + For more information, see https://redis.io/commands/zrevrangebylex """ if (start is not None and num is None) or (num is not None and start is None): raise DataError("``start`` and ``num`` must both be specified") @@ -4718,7 +4718,7 @@ def zrangebyscore( `score_cast_func`` a callable used to cast the score return value - For more information see https://redis.io/commands/zrangebyscore + For more information, see https://redis.io/commands/zrangebyscore """ if (start is not None and num is None) or (num is not None and start is None): raise DataError("``start`` and ``num`` must both be specified") @@ -4753,7 +4753,7 @@ def zrevrangebyscore( ``score_cast_func`` a callable used to cast the score return value - For more information see https://redis.io/commands/zrevrangebyscore + For more information, see https://redis.io/commands/zrevrangebyscore """ if (start is not None and num is None) or (num is not None and start is None): raise DataError("``start`` and ``num`` must both be specified") @@ -4778,7 +4778,7 @@ def zrank( The optional WITHSCORE argument supplements the command's reply with the score of the element returned. - For more information see https://redis.io/commands/zrank + For more information, see https://redis.io/commands/zrank """ if withscore: return self.execute_command("ZRANK", name, value, "WITHSCORE", keys=[name]) @@ -4788,7 +4788,7 @@ def zrem(self, name: KeyT, *values: FieldT) -> ResponseT: """ Remove member ``values`` from sorted set ``name`` - For more information see https://redis.io/commands/zrem + For more information, see https://redis.io/commands/zrem """ return self.execute_command("ZREM", name, *values) @@ -4799,7 +4799,7 @@ def zremrangebylex(self, name: KeyT, min: EncodableT, max: EncodableT) -> Respon Returns the number of elements removed. - For more information see https://redis.io/commands/zremrangebylex + For more information, see https://redis.io/commands/zremrangebylex """ return self.execute_command("ZREMRANGEBYLEX", name, min, max) @@ -4810,7 +4810,7 @@ def zremrangebyrank(self, name: KeyT, min: int, max: int) -> ResponseT: to largest. Values can be negative indicating the highest scores. Returns the number of elements removed - For more information see https://redis.io/commands/zremrangebyrank + For more information, see https://redis.io/commands/zremrangebyrank """ return self.execute_command("ZREMRANGEBYRANK", name, min, max) @@ -4821,7 +4821,7 @@ def zremrangebyscore( Remove all elements in the sorted set ``name`` with scores between ``min`` and ``max``. Returns the number of elements removed. - For more information see https://redis.io/commands/zremrangebyscore + For more information, see https://redis.io/commands/zremrangebyscore """ return self.execute_command("ZREMRANGEBYSCORE", name, min, max) @@ -4837,7 +4837,7 @@ def zrevrank( The optional ``withscore`` argument supplements the command's reply with the score of the element returned. - For more information see https://redis.io/commands/zrevrank + For more information, see https://redis.io/commands/zrevrank """ if withscore: return self.execute_command( @@ -4849,7 +4849,7 @@ def zscore(self, name: KeyT, value: EncodableT) -> ResponseT: """ Return the score of element ``value`` in sorted set ``name`` - For more information see https://redis.io/commands/zscore + For more information, see https://redis.io/commands/zscore """ return self.execute_command("ZSCORE", name, value, keys=[name]) @@ -4865,7 +4865,7 @@ def zunion( Scores will be aggregated based on the ``aggregate``, or SUM if none is provided. - For more information see https://redis.io/commands/zunion + For more information, see https://redis.io/commands/zunion """ return self._zaggregate("ZUNION", None, keys, aggregate, withscores=withscores) @@ -4880,7 +4880,7 @@ def zunionstore( a new sorted set, ``dest``. Scores in the destination will be aggregated based on the ``aggregate``, or SUM if none is provided. - For more information see https://redis.io/commands/zunionstore + For more information, see https://redis.io/commands/zunionstore """ return self._zaggregate("ZUNIONSTORE", dest, keys, aggregate) @@ -4893,7 +4893,7 @@ def zmscore(self, key: KeyT, members: List[str]) -> ResponseT: If the member does not exist, a None will be returned in corresponding position. - For more information see https://redis.io/commands/zmscore + For more information, see https://redis.io/commands/zmscore """ if not members: raise DataError("ZMSCORE members must be a non-empty list") @@ -4945,7 +4945,7 @@ def pfadd(self, name: KeyT, *values: FieldT) -> ResponseT: """ Adds the specified elements to the specified HyperLogLog. - For more information see https://redis.io/commands/pfadd + For more information, see https://redis.io/commands/pfadd """ return self.execute_command("PFADD", name, *values) @@ -4954,7 +4954,7 @@ def pfcount(self, *sources: KeyT) -> ResponseT: Return the approximated cardinality of the set observed by the HyperLogLog at key(s). - For more information see https://redis.io/commands/pfcount + For more information, see https://redis.io/commands/pfcount """ return self.execute_command("PFCOUNT", *sources) @@ -4962,7 +4962,7 @@ def pfmerge(self, dest: KeyT, *sources: KeyT) -> ResponseT: """ Merge N different HyperLogLogs into a single one. - For more information see https://redis.io/commands/pfmerge + For more information, see https://redis.io/commands/pfmerge """ return self.execute_command("PFMERGE", dest, *sources) @@ -4990,7 +4990,7 @@ def hdel(self, name: str, *keys: str) -> Union[Awaitable[int], int]: """ Delete ``keys`` from hash ``name`` - For more information see https://redis.io/commands/hdel + For more information, see https://redis.io/commands/hdel """ return self.execute_command("HDEL", name, *keys) @@ -4998,7 +4998,7 @@ def hexists(self, name: str, key: str) -> Union[Awaitable[bool], bool]: """ Returns a boolean indicating if ``key`` exists within hash ``name`` - For more information see https://redis.io/commands/hexists + For more information, see https://redis.io/commands/hexists """ return self.execute_command("HEXISTS", name, key, keys=[name]) @@ -5008,7 +5008,7 @@ def hget( """ Return the value of ``key`` within the hash ``name`` - For more information see https://redis.io/commands/hget + For more information, see https://redis.io/commands/hget """ return self.execute_command("HGET", name, key, keys=[name]) @@ -5016,7 +5016,7 @@ def hgetall(self, name: str) -> Union[Awaitable[dict], dict]: """ Return a Python dict of the hash's name/value pairs - For more information see https://redis.io/commands/hgetall + For more information, see https://redis.io/commands/hgetall """ return self.execute_command("HGETALL", name, keys=[name]) @@ -5032,7 +5032,7 @@ def hgetdel( the key on success from the hash with the provided ```name```. Available since Redis 8.0 - For more information see https://redis.io/commands/hgetdel + For more information, see https://redis.io/commands/hgetdel """ if len(keys) == 0: raise DataError("'hgetdel' should have at least one key provided") @@ -5068,7 +5068,7 @@ def hgetex( ``persist`` remove the time to live associated with the ``keys``. Available since Redis 8.0 - For more information see https://redis.io/commands/hgetex + For more information, see https://redis.io/commands/hgetex """ if not keys: raise DataError("'hgetex' should have at least one key provided") @@ -5100,7 +5100,7 @@ def hincrby( """ Increment the value of ``key`` in hash ``name`` by ``amount`` - For more information see https://redis.io/commands/hincrby + For more information, see https://redis.io/commands/hincrby """ return self.execute_command("HINCRBY", name, key, amount) @@ -5110,7 +5110,7 @@ def hincrbyfloat( """ Increment the value of ``key`` in hash ``name`` by floating ``amount`` - For more information see https://redis.io/commands/hincrbyfloat + For more information, see https://redis.io/commands/hincrbyfloat """ return self.execute_command("HINCRBYFLOAT", name, key, amount) @@ -5118,7 +5118,7 @@ def hkeys(self, name: str) -> Union[Awaitable[List], List]: """ Return the list of keys within hash ``name`` - For more information see https://redis.io/commands/hkeys + For more information, see https://redis.io/commands/hkeys """ return self.execute_command("HKEYS", name, keys=[name]) @@ -5126,7 +5126,7 @@ def hlen(self, name: str) -> Union[Awaitable[int], int]: """ Return the number of elements in hash ``name`` - For more information see https://redis.io/commands/hlen + For more information, see https://redis.io/commands/hlen """ return self.execute_command("HLEN", name, keys=[name]) @@ -5146,7 +5146,7 @@ def hset( added to hash ``name``. Returns the number of fields that were added. - For more information see https://redis.io/commands/hset + For more information, see https://redis.io/commands/hset """ if key is None and not mapping and not items: @@ -5208,7 +5208,7 @@ def hsetex( Returns the number of fields that were added. Available since Redis 8.0 - For more information see https://redis.io/commands/hsetex + For more information, see https://redis.io/commands/hsetex """ if key is None and not mapping and not items: raise DataError("'hsetex' with no key value pairs") @@ -5251,7 +5251,7 @@ def hsetnx(self, name: str, key: str, value: str) -> Union[Awaitable[bool], bool Set ``key`` to ``value`` within hash ``name`` if ``key`` does not exist. Returns 1 if HSETNX created a field, otherwise 0. - For more information see https://redis.io/commands/hsetnx + For more information, see https://redis.io/commands/hsetnx """ return self.execute_command("HSETNX", name, key, value) @@ -5265,7 +5265,7 @@ def hmset(self, name: str, mapping: dict) -> Union[Awaitable[str], str]: Set key to value within hash ``name`` for each corresponding key and value from the ``mapping`` dict. - For more information see https://redis.io/commands/hmset + For more information, see https://redis.io/commands/hmset """ if not mapping: raise DataError("'hmset' with 'mapping' of length 0") @@ -5278,7 +5278,7 @@ def hmget(self, name: str, keys: List, *args: List) -> Union[Awaitable[List], Li """ Returns a list of values ordered identically to ``keys`` - For more information see https://redis.io/commands/hmget + For more information, see https://redis.io/commands/hmget """ args = list_or_args(keys, args) return self.execute_command("HMGET", name, *args, keys=[name]) @@ -5287,7 +5287,7 @@ def hvals(self, name: str) -> Union[Awaitable[List], List]: """ Return the list of values within hash ``name`` - For more information see https://redis.io/commands/hvals + For more information, see https://redis.io/commands/hvals """ return self.execute_command("HVALS", name, keys=[name]) @@ -5296,7 +5296,7 @@ def hstrlen(self, name: str, key: str) -> Union[Awaitable[int], int]: Return the number of bytes stored in the value of ``key`` within hash ``name`` - For more information see https://redis.io/commands/hstrlen + For more information, see https://redis.io/commands/hstrlen """ return self.execute_command("HSTRLEN", name, key, keys=[name]) @@ -5790,7 +5790,7 @@ def publish(self, channel: ChannelT, message: EncodableT, **kwargs) -> ResponseT Publish ``message`` on ``channel``. Returns the number of subscribers the message was delivered to. - For more information see https://redis.io/commands/publish + For more information, see https://redis.io/commands/publish """ return self.execute_command("PUBLISH", channel, message, **kwargs) @@ -5799,7 +5799,7 @@ def spublish(self, shard_channel: ChannelT, message: EncodableT) -> ResponseT: Posts a message to the given shard channel. Returns the number of clients that received the message - For more information see https://redis.io/commands/spublish + For more information, see https://redis.io/commands/spublish """ return self.execute_command("SPUBLISH", shard_channel, message) @@ -5807,7 +5807,7 @@ def pubsub_channels(self, pattern: PatternT = "*", **kwargs) -> ResponseT: """ Return a list of channels that have at least one subscriber - For more information see https://redis.io/commands/pubsub-channels + For more information, see https://redis.io/commands/pubsub-channels """ return self.execute_command("PUBSUB CHANNELS", pattern, **kwargs) @@ -5815,7 +5815,7 @@ def pubsub_shardchannels(self, pattern: PatternT = "*", **kwargs) -> ResponseT: """ Return a list of shard_channels that have at least one subscriber - For more information see https://redis.io/commands/pubsub-shardchannels + For more information, see https://redis.io/commands/pubsub-shardchannels """ return self.execute_command("PUBSUB SHARDCHANNELS", pattern, **kwargs) @@ -5823,7 +5823,7 @@ def pubsub_numpat(self, **kwargs) -> ResponseT: """ Returns the number of subscriptions to patterns - For more information see https://redis.io/commands/pubsub-numpat + For more information, see https://redis.io/commands/pubsub-numpat """ return self.execute_command("PUBSUB NUMPAT", **kwargs) @@ -5832,7 +5832,7 @@ def pubsub_numsub(self, *args: ChannelT, **kwargs) -> ResponseT: Return a list of (channel, number of subscribers) tuples for each channel given in ``*args`` - For more information see https://redis.io/commands/pubsub-numsub + For more information, see https://redis.io/commands/pubsub-numsub """ return self.execute_command("PUBSUB NUMSUB", *args, **kwargs) @@ -5841,7 +5841,7 @@ def pubsub_shardnumsub(self, *args: ChannelT, **kwargs) -> ResponseT: Return a list of (shard_channel, number of subscribers) tuples for each channel given in ``*args`` - For more information see https://redis.io/commands/pubsub-shardnumsub + For more information, see https://redis.io/commands/pubsub-shardnumsub """ return self.execute_command("PUBSUB SHARDNUMSUB", *args, **kwargs) @@ -5871,7 +5871,7 @@ def eval( In practice, use the object returned by ``register_script``. This function exists purely for Redis API completion. - For more information see https://redis.io/commands/eval + For more information, see https://redis.io/commands/eval """ return self._eval("EVAL", script, numkeys, *keys_and_args) @@ -5885,7 +5885,7 @@ def eval_ro( will touch and the key names and argument values in ``keys_and_args``. Returns the result of the script. - For more information see https://redis.io/commands/eval_ro + For more information, see https://redis.io/commands/eval_ro """ return self._eval("EVAL_RO", script, numkeys, *keys_and_args) @@ -5906,7 +5906,7 @@ def evalsha( In practice, use the object returned by ``register_script``. This function exists purely for Redis API completion. - For more information see https://redis.io/commands/evalsha + For more information, see https://redis.io/commands/evalsha """ return self._evalsha("EVALSHA", sha, numkeys, *keys_and_args) @@ -5921,7 +5921,7 @@ def evalsha_ro( key names and argument values in ``keys_and_args``. Returns the result of the script. - For more information see https://redis.io/commands/evalsha_ro + For more information, see https://redis.io/commands/evalsha_ro """ return self._evalsha("EVALSHA_RO", sha, numkeys, *keys_and_args) @@ -5931,7 +5931,7 @@ def script_exists(self, *args: str) -> ResponseT: each script as ``args``. Returns a list of boolean values indicating if if each already script exists in the cache_data. - For more information see https://redis.io/commands/script-exists + For more information, see https://redis.io/commands/script-exists """ return self.execute_command("SCRIPT EXISTS", *args) @@ -5948,7 +5948,7 @@ def script_flush( ``sync_type`` is by default SYNC (synchronous) but it can also be ASYNC. - For more information see https://redis.io/commands/script-flush + For more information, see https://redis.io/commands/script-flush """ # Redis pre 6 had no sync_type. @@ -5968,7 +5968,7 @@ def script_kill(self) -> ResponseT: """ Kill the currently executing Lua script - For more information see https://redis.io/commands/script-kill + For more information, see https://redis.io/commands/script-kill """ return self.execute_command("SCRIPT KILL") @@ -5976,7 +5976,7 @@ def script_load(self, script: ScriptTextT) -> ResponseT: """ Load a Lua ``script`` into the script cache_data. Returns the SHA. - For more information see https://redis.io/commands/script-load + For more information, see https://redis.io/commands/script-load """ return self.execute_command("SCRIPT LOAD", script) @@ -6039,7 +6039,7 @@ def geoadd( Changed elements include new elements that were added and elements whose scores changed. - For more information see https://redis.io/commands/geoadd + For more information, see https://redis.io/commands/geoadd """ if nx and xx: raise DataError("GEOADD allows either 'nx' or 'xx', not both") @@ -6064,7 +6064,7 @@ def geodist( The units must be one of the following : m, km mi, ft. By default meters are used. - For more information see https://redis.io/commands/geodist + For more information, see https://redis.io/commands/geodist """ pieces: list[EncodableT] = [name, place1, place2] if unit and unit not in ("m", "km", "mi", "ft"): @@ -6078,7 +6078,7 @@ def geohash(self, name: KeyT, *values: FieldT) -> ResponseT: Return the geo hash string for each item of ``values`` members of the specified key identified by the ``name`` argument. - For more information see https://redis.io/commands/geohash + For more information, see https://redis.io/commands/geohash """ return self.execute_command("GEOHASH", name, *values, keys=[name]) @@ -6088,7 +6088,7 @@ def geopos(self, name: KeyT, *values: FieldT) -> ResponseT: the specified key identified by the ``name`` argument. Each position is represented by the pairs lon and lat. - For more information see https://redis.io/commands/geopos + For more information, see https://redis.io/commands/geopos """ return self.execute_command("GEOPOS", name, *values, keys=[name]) @@ -6136,7 +6136,7 @@ def georadius( named with a specific key, instead of ``store`` the sorted set destination score is set with the distance. - For more information see https://redis.io/commands/georadius + For more information, see https://redis.io/commands/georadius """ return self._georadiusgeneric( "GEORADIUS", @@ -6176,7 +6176,7 @@ def georadiusbymember( and latitude value, it takes the name of a member already existing inside the geospatial index represented by the sorted set. - For more information see https://redis.io/commands/georadiusbymember + For more information, see https://redis.io/commands/georadiusbymember """ return self._georadiusgeneric( "GEORADIUSBYMEMBER", @@ -6298,7 +6298,7 @@ def geosearch( ``withhash`` indicates to return the geohash string of each place. - For more information see https://redis.io/commands/geosearch + For more information, see https://redis.io/commands/geosearch """ return self._geosearchgeneric( @@ -6345,7 +6345,7 @@ def geosearchstore( items in a sorted set populated with their distance from the center of the circle or box, as a floating-point number. - For more information see https://redis.io/commands/geosearchstore + For more information, see https://redis.io/commands/geosearchstore """ return self._geosearchgeneric( "GEOSEARCHSTORE", @@ -6450,7 +6450,7 @@ def module_load(self, path, *args) -> ResponseT: Passes all ``*args`` to the module, during loading. Raises ``ModuleError`` if a module is not found at ``path``. - For more information see https://redis.io/commands/module-load + For more information, see https://redis.io/commands/module-load """ return self.execute_command("MODULE LOAD", path, *args) @@ -6463,7 +6463,7 @@ def module_loadex( """ Loads a module from a dynamic library at runtime with configuration directives. - For more information see https://redis.io/commands/module-loadex + For more information, see https://redis.io/commands/module-loadex """ pieces = [] if options is not None: @@ -6480,7 +6480,7 @@ def module_unload(self, name) -> ResponseT: Unloads the module ``name``. Raises ``ModuleError`` if ``name`` is not in loaded modules. - For more information see https://redis.io/commands/module-unload + For more information, see https://redis.io/commands/module-unload """ return self.execute_command("MODULE UNLOAD", name) @@ -6489,7 +6489,7 @@ def module_list(self) -> ResponseT: Returns a list of dictionaries containing the name and version of all loaded modules. - For more information see https://redis.io/commands/module-list + For more information, see https://redis.io/commands/module-list """ return self.execute_command("MODULE LIST") @@ -6525,7 +6525,7 @@ def readwrite(self, **kwargs) -> ResponseT: """ Disables read queries for a connection to a Redis Cluster slave node. - For more information see https://redis.io/commands/readwrite + For more information, see https://redis.io/commands/readwrite """ return self.execute_command("READWRITE", **kwargs) @@ -6533,7 +6533,7 @@ def readonly(self, **kwargs) -> ResponseT: """ Enables read queries for a connection to a Redis Cluster replica node. - For more information see https://redis.io/commands/readonly + For more information, see https://redis.io/commands/readonly """ return self.execute_command("READONLY", **kwargs) @@ -6557,7 +6557,7 @@ def function_load( with the new contents. Return the library name that was loaded. - For more information see https://redis.io/commands/function-load + For more information, see https://redis.io/commands/function-load """ pieces = ["REPLACE"] if replace else [] pieces.append(code) @@ -6567,7 +6567,7 @@ def function_delete(self, library: str) -> Union[Awaitable[str], str]: """ Delete the library called ``library`` and all its functions. - For more information see https://redis.io/commands/function-delete + For more information, see https://redis.io/commands/function-delete """ return self.execute_command("FUNCTION DELETE", library) @@ -6575,7 +6575,7 @@ def function_flush(self, mode: str = "SYNC") -> Union[Awaitable[str], str]: """ Deletes all the libraries. - For more information see https://redis.io/commands/function-flush + For more information, see https://redis.io/commands/function-flush """ return self.execute_command("FUNCTION FLUSH", mode) @@ -6607,7 +6607,7 @@ def fcall( """ Invoke a function. - For more information see https://redis.io/commands/fcall + For more information, see https://redis.io/commands/fcall """ return self._fcall("FCALL", function, numkeys, *keys_and_args) @@ -6618,7 +6618,7 @@ def fcall_ro( This is a read-only variant of the FCALL command that cannot execute commands that modify data. - For more information see https://redis.io/commands/fcall_ro + For more information, see https://redis.io/commands/fcall_ro """ return self._fcall("FCALL_RO", function, numkeys, *keys_and_args) @@ -6626,7 +6626,7 @@ def function_dump(self) -> Union[Awaitable[str], str]: """ Return the serialized payload of loaded libraries. - For more information see https://redis.io/commands/function-dump + For more information, see https://redis.io/commands/function-dump """ from redis.client import NEVER_DECODE @@ -6643,7 +6643,7 @@ def function_restore( You can use the optional policy argument to provide a policy for handling existing libraries. - For more information see https://redis.io/commands/function-restore + For more information, see https://redis.io/commands/function-restore """ return self.execute_command("FUNCTION RESTORE", payload, policy) @@ -6651,7 +6651,7 @@ def function_kill(self) -> Union[Awaitable[str], str]: """ Kill a function that is currently executing. - For more information see https://redis.io/commands/function-kill + For more information, see https://redis.io/commands/function-kill """ return self.execute_command("FUNCTION KILL") @@ -6660,7 +6660,7 @@ def function_stats(self) -> Union[Awaitable[List], List]: Return information about the function that's currently running and information about the available execution engines. - For more information see https://redis.io/commands/function-stats + For more information, see https://redis.io/commands/function-stats """ return self.execute_command("FUNCTION STATS")