redis-py の API リファレンス
redis-py (redis/redis-py) の公開 API 400 件 —— クラス 134、関数 46、メソッド 220。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。
リポジトリ: redis/redis-py
| 種別 | 件数 |
|---|---|
| クラス | 134 |
| 関数 | 46 |
| メソッド | 220 |
API 一覧
func
doctests.search_vss.create_query_table(query, queries, encoded_queries, extra_params=None)Creates a query table.
class
redis._parsers.base.AsyncBaseParserBase parsing class for the python-backed async parser
method
redis._parsers.base.BaseParser.parse_error(response)Parse an error response
class
redis._parsers.base.PushNotificationsParserProtocol defining RESP3-specific parsing functionality
class
redis._parsers.commands.AsyncCommandsParserParses Redis commands to get command keys.
method
redis._parsers.commands.AsyncCommandsParser.get_keys(*args:Any) -> Optional[Tuple[str, ...]]Get the keys from the passed command.
class
redis._parsers.commands.CommandsParserParses Redis commands to get command keys.
class
redis._parsers.encoders.EncoderEncode strings to bytes-like and decode bytes-like to strings
func
redis._parsers.helpers.parse_lcs_idx_unified(response, **options)LCS with IDX → unified ``dict``.
func
redis._parsers.helpers.parse_memory_stats(response, **kwargs)Parse the results of MEMORY STATS
method
redis.asyncio.client.Monitor.listen() -> AsyncIterator[MonitorCommandInfo]Listen for commands coming to the server.
method
redis.asyncio.client.Monitor.next_command() -> MonitorCommandInfoParse the response from a monitor command
method
redis.asyncio.client.Pipeline.aclose() -> NoneAlias for reset(), a standard method name for cleanup
method
redis.asyncio.client.Pipeline.execute(raise_on_error:bool=True) -> List[Any]Execute all the commands in the current pipeline
method
redis.asyncio.client.Pipeline.unwatch()Unwatches all previously specified keys
method
redis.asyncio.client.Pipeline.watch(*names:KeyT)Watches the values at keys ``names``
method
redis.asyncio.client.PubSub.close() -> NoneAlias for aclose(), for backwards compatibility
method
redis.asyncio.client.PubSub.connect()Ensure that the PubSub is connected
method
redis.asyncio.client.PubSub.execute_command(*args:EncodableT)Execute a publish/subscribe command
method
redis.asyncio.client.PubSub.handle_message(response, ignore_subscribe_messages=False)Parses a pub/sub message.
method
redis.asyncio.client.PubSub.ping(message=None) -> Awaitable[bool]Ping the Redis server to test connectivity.
method
redis.asyncio.client.PubSub.psubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to channel patterns.
method
redis.asyncio.client.PubSub.punsubscribe(*args:ChannelT) -> AwaitableUnsubscribe from the supplied patterns.
method
redis.asyncio.client.PubSub.reset() -> NoneAlias for aclose(), for backwards compatibility
method
redis.asyncio.client.PubSub.ssubscribe(*target_node:Any=None, *args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribes the client to the specified shard channels.
method
redis.asyncio.client.PubSub.subscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to channels.
method
redis.asyncio.client.PubSub.sunsubscribe(*target_node=None, *args) -> AwaitableUnsubscribe from the supplied shard_channels.
method
redis.asyncio.client.PubSub.unsubscribe(*args) -> AwaitableUnsubscribe from the supplied channels.
class
redis.asyncio.client.RedisImplementation of the Redis protocol.
method
redis.asyncio.client.Redis.close(close_connection_pool:Optional[bool]=None) -> NoneAlias for aclose(), for backwards compatibility
method
redis.asyncio.client.Redis.execute_command(*args, **options)Execute a command and return a parsed response
method
redis.asyncio.client.Redis.from_pool(connection_pool:ConnectionPool) -> 'Redis'Return a Redis client from the given connection pool.
method
redis.asyncio.client.Redis.get_connection_kwargs()Get the connection's key-word arguments
method
redis.asyncio.client.Redis.get_encoder()Get the connection pool's encoder
method
redis.asyncio.client.Redis.himport_discard(fieldset_name:str) -> intRemove a fieldset from the registry.
method
redis.asyncio.client.Redis.himport_discard_all() -> intRemove all fieldsets from the registry.
method
redis.asyncio.client.Redis.himport_prepare(fieldset_name:str, fields:Iterable[FieldT]) -> boolDeclare an HIMPORT fieldset for use by :meth:`himport_set`.
method
redis.asyncio.client.Redis.pubsub(**kwargs) -> 'PubSub'Return a Publish/Subscribe object.
method
redis.asyncio.client.Redis.set_response_callback(command:str, callback:ResponseCallbackT)Set a custom Response Callback
class
redis.asyncio.cluster.ClusterNodeCreate a new ClusterNode.
method
redis.asyncio.cluster.ClusterNode.disconnect_free_connections() -> NoneDisconnect all free/idle connections in the pool.
method
redis.asyncio.cluster.ClusterNode.disconnect_if_needed(connection:Connection) -> NoneDisconnect a connection if it's marked for reconnect.
method
redis.asyncio.cluster.ClusterNode.release(connection:Connection) -> NoneRelease connection back to free queue.
class
redis.asyncio.cluster.ClusterPipelineCreate a new ClusterPipeline object.
method
redis.asyncio.cluster.ClusterPipeline.execute(raise_on_error:bool=True, allow_redirections:bool=True) -> List[Any]Execute the pipeline.
method
redis.asyncio.cluster.ClusterPipeline.execute_command(*args:Union[KeyT, EncodableT], **kwargs:Any) -> 'ClusterPipeline'Append a raw command to the pipeline.
method
redis.asyncio.cluster.ClusterPipeline.nodes_manager() -> 'NodesManager'Get the nodes manager from the cluster client.
method
redis.asyncio.cluster.ClusterPipeline.reset()Reset back to empty pipeline.
method
redis.asyncio.cluster.ClusterPipeline.set_response_callback(command:str, callback:ResponseCallbackT) -> NoneSet a custom response callback on the cluster client.
method
redis.asyncio.cluster.ClusterPipeline.watch(*names)Watches the values at keys ``names``
class
redis.asyncio.cluster.ClusterPubSubAsync cluster implementation for pub/sub.
method
redis.asyncio.cluster.ClusterPubSub.aclose() -> NoneDisconnect the pubsub connection.
method
redis.asyncio.cluster.ClusterPubSub.execute_command(*args:Any, **kwargs:Any) -> AnyExecute a command on the appropriate cluster node.
method
redis.asyncio.cluster.ClusterPubSub.get_sharded_message(ignore_subscribe_messages:bool=False, timeout:float=0.0, target_node:Optional['ClusterNode']=None) -> Optional[Dict[str, Any]]Get a message from shard channels.
method
redis.asyncio.cluster.ClusterPubSub.ssubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to shard channels.
method
redis.asyncio.cluster.ClusterPubSub.sunsubscribe(*args:Any) -> NoneUnsubscribe from shard channels.
class
redis.asyncio.cluster.RedisClusterCreate a new RedisCluster client.
method
redis.asyncio.cluster.RedisCluster.aclose() -> NoneClose all connections & client if initialized.
method
redis.asyncio.cluster.RedisCluster.close() -> Nonealias for aclose() for backwards compatibility
method
redis.asyncio.cluster.RedisCluster.from_url(url:str, **kwargs:Any) -> 'RedisCluster'Return a Redis client object configured from the given URL.
method
redis.asyncio.cluster.RedisCluster.get_default_node() -> 'ClusterNode'Get the default node of the client.
method
redis.asyncio.cluster.RedisCluster.get_encoder() -> EncoderGet the encoder object of the client.
method
redis.asyncio.cluster.RedisCluster.get_node(host:Optional[str]=None, port:Optional[int]=None, node_name:Optional[str]=None) -> Optional['ClusterNode']Get node by (host, port) or node_name.
method
redis.asyncio.cluster.RedisCluster.get_node_from_key(key:str, replica:bool=False) -> Optional['ClusterNode']Get the cluster node corresponding to the provided key.
method
redis.asyncio.cluster.RedisCluster.get_nodes() -> List['ClusterNode']Get all nodes of the cluster.
method
redis.asyncio.cluster.RedisCluster.get_primaries() -> List['ClusterNode']Get the primary nodes of the cluster.
method
redis.asyncio.cluster.RedisCluster.get_random_node() -> 'ClusterNode'Get a random node of the cluster.
method
redis.asyncio.cluster.RedisCluster.get_random_primary_node() -> 'ClusterNode'Returns a random primary node
method
redis.asyncio.cluster.RedisCluster.get_replicas() -> List['ClusterNode']Get the replica nodes of the cluster.
method
redis.asyncio.cluster.RedisCluster.keyslot(key:EncodableT) -> intFind the keyslot for a given key.
method
redis.asyncio.cluster.RedisCluster.pubsub(node:Optional['ClusterNode']=None, host:Optional[str]=None, port:Optional[int]=None, **kwargs:Any) -> 'ClusterPubSub'Create and return a ClusterPubSub instance.
method
redis.asyncio.cluster.RedisCluster.set_default_node(node:'ClusterNode') -> NoneSet the default node of the client.
method
redis.asyncio.cluster.RedisCluster.set_response_callback(command:str, callback:ResponseCallbackT) -> NoneSet a custom response callback.
class
redis.asyncio.connection.AbstractConnectionManages communication to and from a Redis server
method
redis.asyncio.connection.AbstractConnection.disconnect(nowait:bool=False, error:Optional[Exception]=None, failure_count:Optional[int]=None, health_check_failed:bool=False) -> NoneDisconnects from the Redis server
method
redis.asyncio.connection.AbstractConnection.getpeername() -> str | NoneReturns the peer name of the connection.
method
redis.asyncio.connection.AbstractConnection.pack_command(*args:EncodableT) -> List[bytes]Pack a series of arguments into the Redis protocol
method
redis.asyncio.connection.AbstractConnection.pack_commands(commands:Iterable[Iterable[EncodableT]]) -> List[bytes]Pack multiple commands into the Redis protocol
method
redis.asyncio.connection.AbstractConnection.send_command(*args:Any, **kwargs:Any) -> NonePack and send a command to the Redis server
class
redis.asyncio.connection.ConnectionManages TCP communication to and from a Redis server
class
redis.asyncio.connection.ConnectionPoolCreate a connection pool.
method
redis.asyncio.connection.ConnectionPool.aclose() -> NoneClose the pool, disconnecting all connections
method
redis.asyncio.connection.ConnectionPool.from_url(url:str, **kwargs) -> _CPReturn a connection pool configured from the given URL.
method
redis.asyncio.connection.ConnectionPool.make_connection()Create a new connection.
method
redis.asyncio.connection.ConnectionPool.release(connection:AbstractConnection)Releases the connection back to the pool
class
redis.asyncio.connection.SSLConnectionManages SSL connections to and from the Redis server(s).
class
redis.asyncio.connection.UnixDomainSocketConnectionManages UDS communication to and from a Redis server
class
redis.asyncio.lock.LockA shared, distributed Lock.
method
redis.asyncio.lock.Lock.extend(additional_time:Number, replace_ttl:bool=False) -> Awaitable[Literal[True]]Adds more time to an already acquired lock.
method
redis.asyncio.lock.Lock.release() -> NoneReleases the already acquired lock.
class
redis.asyncio.multidb.client.MultiDBClientClient that operates on multiple logical Redis databases.
method
redis.asyncio.multidb.client.MultiDBClient.add_health_check(healthcheck:HealthCheck)Adds a new health check to the database.
method
redis.asyncio.multidb.client.MultiDBClient.get_databases() -> DatabasesReturns a sorted (by weight) list of all databases.
method
redis.asyncio.multidb.client.MultiDBClient.pubsub(**kwargs)Return a Publish/Subscribe object.
method
redis.asyncio.multidb.client.MultiDBClient.set_active_database(database:AsyncDatabase) -> NonePromote one of the existing databases to become an active.
method
redis.asyncio.multidb.client.Pipeline.aclose() -> NoneClose the pipeline
method
redis.asyncio.multidb.client.Pipeline.execute() -> List[Any]Execute all the commands in the current pipeline
method
redis.asyncio.multidb.client.Pipeline.execute_command(*args, **kwargs)Adds a command to the stack
class
redis.asyncio.multidb.client.PubSubPubSub object for multi database client.
method
redis.asyncio.multidb.client.PubSub.psubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to channel patterns.
method
redis.asyncio.multidb.client.PubSub.punsubscribe(*args:ChannelT)Unsubscribe from the supplied patterns.
method
redis.asyncio.multidb.client.PubSub.run(*exception_handler=None, *poll_timeout:float=1.0) -> NoneProcess pub/sub messages using registered callbacks.
method
redis.asyncio.multidb.client.PubSub.subscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to channels.
class
redis.asyncio.multidb.database.AsyncDatabaseDatabase with an underlying asynchronous redis client.
method
redis.asyncio.multidb.database.AsyncDatabase.circuit() -> CircuitBreakerCircuit breaker for the current database.
method
redis.asyncio.multidb.database.AsyncDatabase.client() -> Union[Redis, RedisCluster]The underlying redis client.
class
redis.asyncio.multidb.event.CloseConnectionOnActiveDatabaseChangedClose connection to the old active database.
class
redis.asyncio.multidb.failover.DefaultFailoverStrategyExecutorExecutes given failover strategy.
class
redis.asyncio.multidb.failover.WeightBasedFailoverStrategyFailover strategy based on database weights.
class
redis.asyncio.multidb.failure_detector.FailureDetectorAsyncWrapperAsync wrapper for the failure detector.
class
redis.asyncio.multidb.healthcheck.AbstractHealthCheckPolicyAbstract health check policy.
method
redis.asyncio.multidb.healthcheck.AbstractHealthCheckPolicy.close() -> NoneClose all health check clients.
class
redis.asyncio.multidb.healthcheck.HealthCheckHealth check interface.
method
redis.asyncio.multidb.healthcheck.HealthCheck.check_health(database, hc_client:AsyncRedisClientT) -> boolFunction to determine the health status.
method
redis.asyncio.multidb.healthcheck.HealthCheck.health_check_delay() -> floatDelay between health check probes.
method
redis.asyncio.multidb.healthcheck.HealthCheck.health_check_probes() -> intNumber of probes to execute health checks.
class
redis.asyncio.multidb.healthcheck.HealthCheckPolicyHealth checks execution policy.
method
redis.asyncio.multidb.healthcheck.HealthCheckPolicy.close() -> NoneClose all health check clients.
method
redis.asyncio.multidb.healthcheck.HealthCheckPolicy.get_client(database) -> AsyncRedisClientTGet a health check client for the database.
method
redis.asyncio.multidb.healthcheck.LagAwareHealthCheck.check_health(database, hc_client:AsyncRedisClientT) -> boolCheck database health via Redis Enterprise REST API.
class
redis.asyncio.multidb.healthcheck.PingHealthCheckHealth check based on PING command.
func
redis.asyncio.observability.recorder.is_enabled() -> boolCheck if observability is enabled.
func
redis.asyncio.observability.recorder.record_connection_closed(close_reason:Optional[CloseReason]=None, error_type:Optional[Exception]=None) -> NoneRecord a connection closed event.
func
redis.asyncio.observability.recorder.record_connection_count(pool_name:str, connection_state:ConnectionState, counter:int=1) -> NoneRecord a connection count change for a single state.
func
redis.asyncio.observability.recorder.record_connection_create_time(connection_pool:'ConnectionPool', duration_seconds:float) -> NoneRecord connection creation time.
func
redis.asyncio.observability.recorder.record_connection_relaxed_timeout(connection_name:str, maint_notification:str, relaxed:bool) -> NoneRecord a connection timeout relaxation event.
func
redis.asyncio.observability.recorder.record_connection_timeout(pool_name:str) -> NoneRecord a connection timeout event.
func
redis.asyncio.observability.recorder.record_error_count(server_address:str, server_port:int, network_peer_address:str, network_peer_port:int, error_type:Exception, retry_attempts:int, is_internal:bool=True) -> NoneRecord error count.
func
redis.asyncio.observability.recorder.record_geo_failover(fail_from:'AsyncDatabase', fail_to:'AsyncDatabase', reason:GeoFailoverReason) -> NoneRecord a geo failover.
func
redis.asyncio.observability.recorder.record_pubsub_message(direction:PubSubDirection, channel:Optional[str]=None, sharded:Optional[bool]=None) -> NoneRecord a PubSub message (published or received).
func
redis.asyncio.observability.recorder.record_streaming_lag(lag_seconds:float, stream_name:Optional[str]=None, consumer_group:Optional[str]=None) -> NoneRecord the lag of a streaming message.
method
redis.asyncio.sentinel.Sentinel.discover_slaves(service_name:str) -> Sequence[Tuple[EncodableT, EncodableT]]Returns a list of alive slaves for service ``service_name``
method
redis.asyncio.sentinel.Sentinel.filter_replicas(replicas:Iterable[Mapping]) -> Sequence[Tuple[EncodableT, EncodableT]]Remove replicas that are in an ODOWN or SDOWN state.
method
redis.asyncio.sentinel.Sentinel.filter_slaves(slaves:Iterable[Mapping]) -> Sequence[Tuple[EncodableT, EncodableT]]Remove slaves that are in an ODOWN or SDOWN state
class
redis.asyncio.sentinel.SentinelConnectionPoolSentinel backed connection pool.
method
redis.asyncio.sentinel.SentinelConnectionPool.rotate_replicas() -> AsyncIteratorRound-robin replica balancer.
method
redis.asyncio.sentinel.SentinelConnectionPool.rotate_slaves() -> AsyncIteratorRound-robin slave balancer
func
redis.asyncio.utils.from_url(url:str, **kwargs:Any) -> 'Redis'Returns an active Redis client generated from the given database URL.
class
redis.auth.err.InvalidTokenSchemaErrRepresents an exception related to invalid token schema.
class
redis.auth.err.RequestTokenErrRepresents an exception during token request.
class
redis.auth.err.TokenRenewalErrRepresents an exception during token renewal process.
class
redis.auth.idp.IdentityProviderInterfaceReceive a token from the identity provider.
method
redis.auth.token_manager.RetryPolicy.get_delay_in_ms() -> floatDelay between retries in seconds.
method
redis.auth.token_manager.RetryPolicy.get_max_attempts() -> intRetry attempts before exception will be thrown.
func
redis.background.BackgroundScheduler.on_complete(future:asyncio.Future)Log any exceptions from the coroutine.
class
redis.backoff.AbstractBackoffBackoff interface
method
redis.backoff.AbstractBackoff.compute(failures:int) -> floatCompute backoff in seconds upon failure
class
redis.backoff.ConstantBackoffConstant backoff upon failure
class
redis.backoff.DecorrelatedJitterBackoffDecorrelated jitter backoff upon failure
class
redis.backoff.EqualJitterBackoffEqual jitter backoff upon failure
class
redis.backoff.ExponentialBackoffExponential backoff upon failure
class
redis.backoff.ExponentialWithJitterBackoffExponential backoff upon failure, with jitter
class
redis.backoff.FullJitterBackoffFull jitter backoff upon failure
class
redis.backoff.NoBackoffNo backoff upon failure
class
redis.cache.CacheKeyRepresents a unique key for a cache entry.
class
redis.client.CaseInsensitiveDictCase insensitive dict implementation.
method
redis.client.Monitor.listen()Listen for commands coming to the server.
method
redis.client.Monitor.next_command()Parse the response from a monitor command
method
redis.client.Pipeline.close() -> NoneClose the pipeline
method
redis.client.Pipeline.execute(raise_on_error:bool=True) -> List[Any]Execute all the commands in the current pipeline
method
redis.client.Pipeline.unwatch() -> boolUnwatches all previously specified keys
method
redis.client.Pipeline.watch(*names)Watches the values at keys ``names``
method
redis.client.PubSub.clean_health_check_responses() -> NoneIf any health check responses are present, clean them
method
redis.client.PubSub.execute_command(*args)Execute a publish/subscribe command
method
redis.client.PubSub.handle_message(response, ignore_subscribe_messages=False)Parses a pub/sub message.
method
redis.client.PubSub.is_health_check_response(response) -> boolCheck if the response is a health check response.
method
redis.client.PubSub.ping(message:Union[str, None]=None) -> boolPing the Redis server to test connectivity.
method
redis.client.PubSub.psubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to channel patterns.
method
redis.client.PubSub.punsubscribe(*args)Unsubscribe from the supplied patterns.
method
redis.client.PubSub.ssubscribe(*target_node:Any=None, *args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribes the client to the specified shard channels.
method
redis.client.PubSub.subscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to channels.
method
redis.client.PubSub.unsubscribe(*args)Unsubscribe from the supplied channels.
class
redis.client.RedisImplementation of the Redis protocol.
method
redis.client.Redis.from_pool(connection_pool:ConnectionPool) -> 'Redis'Return a Redis client from the given connection pool.
method
redis.client.Redis.get_connection_kwargs() -> DictGet the connection's key-word arguments
method
redis.client.Redis.get_encoder() -> 'Encoder'Get the connection pool's encoder
method
redis.client.Redis.himport_discard(fieldset_name:str) -> intRemove a fieldset from the registry.
method
redis.client.Redis.himport_discard_all() -> intRemove all fieldsets from the registry.
method
redis.client.Redis.himport_prepare(fieldset_name:str, fields:Iterable[FieldT]) -> boolDeclare an HIMPORT fieldset for use by :meth:`himport_set`.
method
redis.client.Redis.pubsub(**kwargs)Return a Publish/Subscribe object.
method
redis.client.Redis.set_response_callback(command:str, callback:Callable) -> NoneSet a custom Response Callback
class
redis.cluster.ClusterPipelineSupport for Redis pipeline in cluster mode
method
redis.cluster.ClusterPipeline.execute(raise_on_error:bool=True) -> List[Any]Execute all the commands in the current pipeline
method
redis.cluster.ClusterPipeline.reset()Reset back to empty pipeline.
method
redis.cluster.ClusterPipeline.unwatch()Unwatches all previously specified keys
method
redis.cluster.ClusterPipeline.watch(*names)Watches the values at keys ``names``
class
redis.cluster.ClusterPubSubWrapper for PubSub class.
method
redis.cluster.ClusterPubSub.disconnect()Disconnect the pubsub connection.
method
redis.cluster.ClusterPubSub.ssubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to shard channels.
class
redis.cluster.LoadBalancerRound-Robin Load Balancing
method
redis.cluster.RedisCluster.determine_slot(*args) -> Optional[int]Figure out what slot to use based on args.
method
redis.cluster.RedisCluster.get_default_node()Get the cluster's default node
method
redis.cluster.RedisCluster.get_encoder()Get the connections' encoder
method
redis.cluster.RedisCluster.get_random_primary_node() -> 'ClusterNode'Returns a random primary node
method
redis.cluster.RedisCluster.keyslot(key)Calculate keyslot for a given key.
method
redis.cluster.RedisCluster.set_default_node(node)Set the default node of the cluster.
method
redis.cluster.RedisCluster.set_response_callback(command, callback)Set a custom Response Callback
func
redis.cluster.parse_cluster_myshardid(resp, **options)Parse CLUSTER MYSHARDID response.
func
redis.cluster.parse_cluster_shards(resp, **options)Parse CLUSTER SHARDS response.
class
redis.commands.bf.commands.BFCommandsBloom Filter commands.
class
redis.commands.bf.commands.CFCommandsCuckoo Filter commands.
class
redis.commands.bf.commands.CMSCommandsCount-Min Sketch Commands
class
redis.commands.bf.commands.TOPKCommandsTOP-k Filter commands.
method
redis.commands.cluster.AsyncClusterMultiKeyCommands.mset_nonatomic(mapping:Mapping[AnyKeyT, EncodableT]) -> List[bool]Sets key/values based on a mapping.
class
redis.commands.cluster.ClusterMultiKeyCommandsA class containing commands that handle more than one key
method
redis.commands.cluster.ClusterMultiKeyCommands.mset_nonatomic(mapping:Mapping[AnyKeyT, EncodableT]) -> List[bool]Sets key/values based on a mapping.
class
redis.commands.json.ClusterPipelineCluster pipeline for the module.
class
redis.commands.json.PipelinePipeline for the module.
class
redis.commands.json.commands.JSONCommandsjson commands.
class
redis.commands.json.path.PathThis class represents a path in a JSON value.
class
redis.commands.policies.AsyncBasePolicyResolverAsync base class for policy resolvers.
class
redis.commands.policies.AsyncDynamicPolicyResolverAsync version of DynamicPolicyResolver.
class
redis.commands.policies.AsyncStaticPolicyResolverAsync version of StaticPolicyResolver.
class
redis.commands.policies.BasePolicyResolverBase class for policy resolvers.
class
redis.commands.policies.DynamicPolicyResolverResolves policy dynamically based on the COMMAND output.
class
redis.commands.policies.StaticPolicyResolverResolves policy from a static list of policy records.
class
redis.commands.search.AsyncPipelineAsyncPipeline for the module.
class
redis.commands.search.PipelinePipeline for the module.
class
redis.commands.search.SearchCreate a client for talking to search.
class
redis.commands.search.aggregation.ReducerBase reducer object for all reducers.
method
redis.commands.search.aggregation.Reducer.alias(alias:str) -> 'Reducer'Set the alias for this reducer.
class
redis.commands.search.aggregation.SortDirectionThis special class is used to indicate sort direction.
class
redis.commands.search.commands.SearchCommandsSearch commands.
method
redis.commands.search.commands.SearchCommands.config_get(option:str) -> strGet runtime configuration option value.
method
redis.commands.search.commands.SearchCommands.config_set(option:str, value:str) -> boolSet runtime configuration option.
method
redis.commands.search.commands.SearchCommands.dict_add(name:str, *terms:List[str])Adds terms to a dictionary.
method
redis.commands.search.commands.SearchCommands.dict_del(name:str, *terms:List[str])Deletes terms from a dictionary.
method
redis.commands.search.commands.SearchCommands.dict_dump(name:str)Dumps all terms in the given dictionary.
method
redis.commands.search.commands.SearchCommands.dropindex(delete_documents:bool=False)Drop the index if it exists.
method
redis.commands.search.commands.SearchCommands.sugdel(key:str, string:str) -> intDelete a string from the AutoCompleter index.
method
redis.commands.search.commands.SearchCommands.suglen(key:str) -> intReturn the number of entries in the AutoCompleter index.
method
redis.commands.search.commands.SearchCommands.synupdate(groupid:str, skipinitial:bool=False, *terms:List[str])Updates a synonym group.
class
redis.commands.search.document.DocumentRepresents a single document in a result set
class
redis.commands.search.field.FieldA class representing a field in a document.
class
redis.commands.search.index_definition.IndexTypeEnum of the currently supported index types.
class
redis.commands.search.profile_information.ProfileInformationWrapper around FT.PROFILE response
method
redis.commands.search.query.Query.add_filter(flt:'Filter') -> 'Query'Add a numeric or geo filter to the query.
method
redis.commands.search.query.Query.dialect(dialect:int) -> 'Query'Add a dialect field to the query.
method
redis.commands.search.query.Query.expander(expander:str) -> 'Query'Add an expander field to the query.
method
redis.commands.search.query.Query.language(language:str) -> 'Query'Analyze the query as being in the specified language.
method
redis.commands.search.query.Query.limit_fields(*fields:str) -> 'Query'Limit the search to specific TEXT fields only.
method
redis.commands.search.query.Query.no_stopwords() -> 'Query'Prevent the query from being filtered for stopwords.
method
redis.commands.search.query.Query.paging(offset:int, num:int) -> 'Query'Set the paging for the query (defaults to 0..10).
method
redis.commands.search.query.Query.query_string() -> strReturn the query string of this query only.
method
redis.commands.search.query.Query.return_field(field:str, as_field:Optional[str]=None, decode_field:Optional[bool]=True, encoding:Optional[str]='utf8') -> 'Query'Add a field to the list of fields to return.
method
redis.commands.search.query.Query.return_fields(*fields) -> 'Query'Add fields to return fields.
method
redis.commands.search.query.Query.scorer(scorer:str) -> 'Query'Use a different scoring function to evaluate document relevance.
method
redis.commands.search.query.Query.sort_by(field:str, asc:bool=True) -> 'Query'Add a sortby field to the query.
method
redis.commands.search.query.Query.timeout(timeout:float) -> 'Query'overrides the timeout parameter of the module
method
redis.commands.search.query.Query.with_payloads() -> 'Query'Ask the engine to return document payloads.
method
redis.commands.search.query.Query.with_scores() -> 'Query'Ask the engine to return document search scores.
class
redis.commands.search.querystring.DisjunctNodeCreate a disjunct node.
class
redis.commands.search.querystring.DistjunctUnionThis node is true if *all* of its children are false.
class
redis.commands.search.querystring.IntersectNodeCreate an intersection node.
class
redis.commands.search.querystring.OptionalNodeCreate an optional node.
class
redis.commands.search.querystring.UnionNodeCreate a union node.
func
redis.commands.search.querystring.between(a, b, inclusive_min=True, inclusive_max=True)Indicate that value is a numeric range
func
redis.commands.search.querystring.equal(n)Match a numeric value
func
redis.commands.search.querystring.ge(n)Match any value greater or equal to n
func
redis.commands.search.querystring.gt(n)Match any value greater than n
func
redis.commands.search.querystring.le(n)Match any value less or equal to n
func
redis.commands.search.querystring.lt(n)Match any value less than n
class
redis.commands.search.reducers.avgCalculates the mean value in the given field within the group
class
redis.commands.search.reducers.countCounts the number of results in the group
class
redis.commands.search.reducers.tolistReturns all the matched properties in a list
method
redis.commands.search.result.Result.from_resp3(res:dict, duration:float=0, with_scores:bool=False, field_encodings:Optional[dict]=None) -> 'Result'Construct a Result from a RESP3 dict response.
class
redis.commands.sentinel.SentinelCommandsA class containing the commands specific to redis sentinel.
method
redis.commands.sentinel.SentinelCommands.sentinel(*args)Redis Sentinel's SENTINEL command.
class
redis.commands.timeseries.ClusterPipelineCluster pipeline for the module.
class
redis.commands.timeseries.PipelinePipeline for the module.
class
redis.commands.timeseries.commands.TimeSeriesCommandsRedisTimeSeries Commands.
class
redis.commands.timeseries.info.TSInfoHold information and statistics on the time-series.
func
redis.commands.timeseries.utils.parse_get(response)Parse get response.
func
redis.commands.timeseries.utils.parse_get_unified(response, **kwargs)Unified parser for TS.GET.
func
redis.commands.timeseries.utils.parse_m_get_unified(response, **kwargs)Unified parser for TS.MGET.
func
redis.commands.timeseries.utils.parse_range(response, **kwargs)Parse range response.
class
redis.commands.vectorset.AsyncVectorSetAsync VectorSet client.
class
redis.commands.vectorset.VectorSetSync VectorSet client.
class
redis.commands.vectorset.commands.CallbacksOptionsOptions that can be set for the commands callbacks
class
redis.commands.vectorset.commands.QuantizationOptionsQuantization options for the VADD command.
class
redis.commands.vectorset.commands.VectorSetCommandsRedis VectorSet commands
class
redis.connection.AbstractConnectionManages communication to and from a Redis server
method
redis.connection.AbstractConnection.can_read(timeout:float=0) -> boolPoll the socket to see if there's data that can be read.
method
redis.connection.AbstractConnection.disconnect(*args, **kwargs)Disconnects from the Redis server
class
redis.connection.ConnectionManages TCP communication to and from a Redis server
class
redis.connection.ConnectionPoolCreate a connection pool.
method
redis.connection.ConnectionPool.close() -> NoneClose the pool, disconnecting all connections
method
redis.connection.ConnectionPool.from_url(url:str, **kwargs) -> _CPReturn a connection pool configured from the given URL.
method
redis.connection.ConnectionPool.get_connection(command_name=None, *keys, **options) -> 'Connection'Get a connection from the pool
method
redis.connection.ConnectionPool.get_encoder() -> EncoderReturn an encoder based on encoding settings
method
redis.connection.ConnectionPool.make_connection() -> 'ConnectionInterface'Create a new connection
method
redis.connection.ConnectionPool.release(connection:'Connection') -> NoneReleases the connection back to the pool
class
redis.connection.SSLConnectionManages SSL connections to and from the Redis server(s).
class
redis.connection.UnixDomainSocketConnectionManages UDS communication to and from a Redis server
func
redis.crc.key_slot(key:EncodedT, bucket:int=REDIS_CLUSTER_HASH_SLOTS) -> intCalculate key slot for a given key.
class
redis.credentials.CredentialProviderCredentials Provider.
class
redis.data_structure.WeightedListThread-safe weighted list.
method
redis.data_structure.WeightedList.add(item:Any, weight:float) -> NoneAdd item with weight, maintaining sorted order
method
redis.data_structure.WeightedList.get_by_weight_range(min_weight:float, max_weight:float) -> List[tuple[Any, Number]]Get all items within weight range
method
redis.data_structure.WeightedList.get_top_n(n:int) -> List[tuple[Any, Number]]Get top N the highest weighted items
method
redis.data_structure.WeightedList.remove(item)Remove first occurrence of item
method
redis.driver_info.DriverInfo.add_upstream_driver(driver_name:str, driver_version:str) -> 'DriverInfo'Add an upstream driver to this instance and return self.
method
redis.driver_info.DriverInfo.upstream_drivers() -> List[str]Return a copy of the upstream driver entries.
func
redis.driver_info.resolve_driver_info(driver_info:Optional[DriverInfo] | object=SENTINEL, lib_name:Optional[str] | object=SENTINEL, lib_version:Optional[str] | object=SENTINEL) -> Optional[DriverInfo]Resolve driver_info from parameters.
class
redis.event.AfterConnectionReleasedEventEvent that will be fired before each command execution.
class
redis.event.AsyncEventListenerInterfaceRepresents an async listener for given event object.
class
redis.event.EventListenerInterfaceRepresents a listener for given event object.
class
redis.event.OnCommandsFailEventEvent fired whenever a command fails during the execution.
class
redis.exceptions.AskErrorError indicated ASK error received from cluster.
class
redis.exceptions.ClusterCrossSlotErrorError indicated CROSSSLOT error received from cluster.
class
redis.exceptions.ClusterDownErrorError indicated CLUSTERDOWN error received from cluster.
class
redis.exceptions.InvalidPipelineStackRaised on unexpected response length on pipelines.
class
redis.exceptions.LockErrorErrors acquiring or releasing a lock
class
redis.exceptions.MasterDownErrorError indicated MASTERDOWN error received from cluster.
class
redis.exceptions.MovedErrorError indicated MOVED error received from cluster.
class
redis.exceptions.OutOfMemoryErrorIndicates the database is full.
class
redis.exceptions.RedisClusterExceptionBase exception for the RedisCluster client
class
redis.exceptions.TryAgainErrorError indicated TRYAGAIN error received from cluster.
class
redis.himport.HImportFieldsetAn immutable HIMPORT fieldset entry.
class
redis.himport.HImportRegistryClient-level registry of HIMPORT fieldsets.
method
redis.himport.HImportRegistry.discard(name:str) -> boolRemove a fieldset from the registry.
method
redis.himport.HImportRegistry.discard_all() -> intRemove all fieldsets and return the number removed.
method
redis.himport.HImportRegistry.get(name:str) -> HImportFieldset | NoneReturn the fieldset registered under ``name``, or ``None``.
method
redis.himport.HImportRegistry.items() -> list[tuple[str, HImportFieldset]]Return a snapshot of ``(name, fieldset)`` pairs.
method
redis.himport.HImportRegistry.names() -> list[str]Return the registered fieldset names.
method
redis.himport.HImportRegistry.names_to_discard(prepared_names:Iterable[str]) -> list[str]Return which of ``prepared_names`` are no longer registered.
func
redis.himport.himport_discard_command(fieldset_name:str) -> tuplePositional wire args for ``HIMPORT DISCARD fieldset_name``.
class
redis.http.http_client.HttpClientA lightweight HTTP client for REST API calls.
class
redis.keyspace_notifications.EventTypeCommon Redis keyspace notification event type constants.
class
redis.keyspace_notifications.KeyspaceNotificationsInterfaceInterface for keyspace notification managers.
class
redis.keyspace_notifications.KeyspaceWorkerThreadBackground thread for processing keyspace notifications.
method
redis.keyspace_notifications.KeyspaceWorkerThread.stop() -> NoneStop the worker thread.
func
redis.keyspace_notifications.get_channel_type(channel:str | bytes) -> ChannelType | NoneDetermine the type of a Redis keyspace notification channel.
class
redis.lock.LockA shared, distributed Lock.
method
redis.lock.Lock.extend(additional_time:Number, replace_ttl:bool=False) -> Literal[True]Adds more time to an already acquired lock.
method
redis.lock.Lock.owned() -> boolReturns True if this key is locked by this lock, otherwise False.
method
redis.lock.Lock.release() -> NoneReleases the already acquired lock
class
redis.multidb.circuit.BaseCircuitBreakerBase implementation of Circuit Breaker interface.
class
redis.multidb.client.MultiDBClientClient that operates on multiple logical Redis databases.
method
redis.multidb.client.MultiDBClient.add_health_check(healthcheck:HealthCheck)Adds a new health check to the database.
method
redis.multidb.client.MultiDBClient.close()Closes the client and all its resources.
method
redis.multidb.client.MultiDBClient.get_databases() -> DatabasesReturns a sorted (by weight) list of all databases.
method
redis.multidb.client.MultiDBClient.pubsub(**kwargs)Return a Publish/Subscribe object.
method
redis.multidb.client.MultiDBClient.remove_database(database:Database)Removes a database from the database list.
method
redis.multidb.client.MultiDBClient.set_active_database(database:SyncDatabase) -> NonePromote one of the existing databases to become an active.
method
redis.multidb.client.MultiDBClient.transaction(func:Callable[['Pipeline'], None], *watches, **options)Executes callable as transaction.
class
redis.multidb.client.PipelinePipeline implementation for multiple logical Redis databases.
method
redis.multidb.client.Pipeline.close() -> NoneClose the pipeline
method
redis.multidb.client.Pipeline.execute() -> List[Any]Execute all the commands in the current pipeline
method
redis.multidb.client.Pipeline.execute_command(*args, **kwargs)Adds a command to the stack
class
redis.multidb.client.PubSubPubSub object for multi database client.
method
redis.multidb.client.PubSub.psubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to channel patterns.
method
redis.multidb.client.PubSub.ssubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribes the client to the specified shard channels.
method
redis.multidb.client.PubSub.subscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> NoneSubscribe to channels.
class
redis.multidb.database.SyncDatabaseDatabase with an underlying synchronous redis client.
method
redis.multidb.database.SyncDatabase.circuit() -> CircuitBreakerCircuit breaker for the current database.
method
redis.multidb.database.SyncDatabase.client() -> Union[redis.Redis, RedisCluster]The underlying redis client.
class
redis.multidb.event.ActiveDatabaseChangedEvent fired when an active database has been changed.
class
redis.multidb.event.CloseConnectionOnActiveDatabaseChangedClose connection to the old active database.
class
redis.multidb.exception.InitialHealthCheckFailedErrorException raised when initial health check fails.
class
redis.multidb.failover.DefaultFailoverStrategyExecutorExecutes given failover strategy.
class
redis.multidb.failover.WeightBasedFailoverStrategyFailover strategy based on database weights.
class
redis.observability.config.MetricGroupMetric groups that can be enabled/disabled.
class
redis.observability.config.OTelConfigConfiguration for OpenTelemetry observability in redis-py.
method
redis.observability.config.OTelConfig.is_enabled() -> boolCheck if any observability feature is enabled.
class
redis.observability.config.TelemetryOptionTelemetry options to export.
class
redis.observability.providers.OTelProviderManagerManages OpenTelemetry SDK providers and their lifecycle.
method
redis.observability.providers.OTelProviderManager.force_flush(timeout_millis:int=30000) -> boolForce flush any pending metrics from the global MeterProvider.
method
redis.observability.providers.OTelProviderManager.shutdown(timeout_millis:int=30000) -> boolShutdown observability and flush any pending metrics.
method
redis.observability.providers.ObservabilityInstance.force_flush(timeout_millis:int=30000) -> boolForce flush all pending metrics immediately.
method
redis.observability.providers.ObservabilityInstance.get_provider_manager() -> Optional[OTelProviderManager]Get the provider manager instance.
method
redis.observability.providers.ObservabilityInstance.is_enabled() -> boolCheck if observability is enabled.
method
redis.observability.providers.ObservabilityInstance.shutdown(timeout_millis:int=30000) -> boolShutdown observability and flush any pending metrics.
func
redis.observability.providers.reset_observability_instance() -> NoneReset the global observability singleton instance.
func
redis.observability.recorder.init_csc_items() -> NoneInitialize observable gauge for CSC items metric.
func
redis.observability.recorder.is_enabled() -> boolCheck if observability is enabled.
func
redis.observability.recorder.record_connection_closed(close_reason:Optional[CloseReason]=None, error_type:Optional[Exception]=None) -> NoneRecord a connection closed event.
func
redis.observability.recorder.record_connection_count(pool_name:str, connection_state:ConnectionState, counter:int=1) -> NoneRecord a connection count change for a single state.
func
redis.observability.recorder.record_connection_create_time(connection_pool:'ConnectionPoolInterface', duration_seconds:float) -> NoneRecord connection creation time.
func
redis.observability.recorder.record_connection_relaxed_timeout(connection_name:str, maint_notification:str, relaxed:bool) -> NoneRecord a connection timeout relaxation event.
func
redis.observability.recorder.record_connection_timeout(pool_name:str) -> NoneRecord a connection timeout event.
func
redis.observability.recorder.record_connection_wait_time(pool_name:str, duration_seconds:float) -> NoneRecord time taken to obtain a connection from the pool.
func
redis.observability.recorder.record_csc_eviction(count:int, reason:Optional[CSCReason]=None) -> NoneRecord a Client Side Caching (CSC) eviction.
func
redis.observability.recorder.record_geo_failover(fail_from:'SyncDatabase', fail_to:'SyncDatabase', reason:GeoFailoverReason) -> NoneRecord a geo failover.
func
redis.observability.recorder.record_maint_notification_count(server_address:str, server_port:int, network_peer_address:str, network_peer_port:int, maint_notification:str) -> NoneRecord a maintenance notification count.
func
redis.observability.recorder.record_pubsub_message(direction:PubSubDirection, channel:Optional[str]=None, sharded:Optional[bool]=None) -> NoneRecord a PubSub message (published or received).
func
redis.observability.recorder.record_streaming_lag(lag_seconds:float, stream_name:Optional[str]=None, consumer_group:Optional[str]=None, consumer_name:Optional[str]=None) -> NoneRecord the lag of a streaming message.
func
redis.observability.recorder.register_csc_items_callback(callback:Callable, pool_name:Optional[str]=None) -> NoneAdds given callback to CSC items observable registry.
method
redis.observability.registry.ObservablesRegistry.clear() -> NoneClear the registry.
method
redis.observability.registry.ObservablesRegistry.get(name:str) -> List[Callable[[], List[Any]]]Get all callbacks for an observable metric.
method
redis.observability.registry.ObservablesRegistry.register(name:str, callback:Callable[[], List[Any]]) -> NoneRegister a callback for an observable metric.
class
redis.ocsp.OCSPVerifierA class to verify ssl sockets for RFC6960/RFC6961.
method
redis.ocsp.OCSPVerifier.build_certificate_url(server, cert, issuer_cert)Return the complete url to the ocsp
class
redis.retry.AbstractRetryRetry a specific number of times after a failure
method
redis.retry.AbstractRetry.get_retries() -> intGet the number of retries.
method
redis.retry.AbstractRetry.update_retries(value:int) -> NoneSet the number of retries.
method
redis.retry.AbstractRetry.update_supported_errors(specified_errors:Iterable[Type[E]]) -> NoneUpdates the supported errors with the specified error types
class
redis.sentinel.SentinelConnectionPoolSentinel backed connection pool.
method
redis.sentinel.SentinelConnectionPool.rotate_replicas()Round-robin replica balancer.
method
redis.sentinel.SentinelConnectionPool.rotate_slaves()Round-robin slave balancer
この情報について
掲載しているシグネチャは redis/redis-py の公開ソースコードを
Python の ast モジュールで静的解析し、引数名・デフォルト値・
型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。
詳しくは仕組みの解説をご覧ください。