brk-code

redis-py の API リファレンス

redis-py (redis/redis-py) の公開 API 400 件 —— クラス 134、関数 46、メソッド 220。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: redis/redis-py

種別件数
クラス134
関数46
メソッド220

API 一覧

funcdoctests.search_vss.create_query_table(query, queries, encoded_queries, extra_params=None)
Creates a query table.
classredis._parsers.base.AsyncBaseParser
Base parsing class for the python-backed async parser
methodredis._parsers.base.BaseParser.parse_error(response)
Parse an error response
classredis._parsers.base.PushNotificationsParser
Protocol defining RESP3-specific parsing functionality
classredis._parsers.commands.AsyncCommandsParser
Parses Redis commands to get command keys.
methodredis._parsers.commands.AsyncCommandsParser.get_keys(*args:Any) -> Optional[Tuple[str, ...]]
Get the keys from the passed command.
classredis._parsers.commands.CommandsParser
Parses Redis commands to get command keys.
classredis._parsers.encoders.Encoder
Encode strings to bytes-like and decode bytes-like to strings
funcredis._parsers.helpers.parse_lcs_idx_unified(response, **options)
LCS with IDX → unified ``dict``.
funcredis._parsers.helpers.parse_memory_stats(response, **kwargs)
Parse the results of MEMORY STATS
methodredis.asyncio.client.Monitor.listen() -> AsyncIterator[MonitorCommandInfo]
Listen for commands coming to the server.
methodredis.asyncio.client.Monitor.next_command() -> MonitorCommandInfo
Parse the response from a monitor command
methodredis.asyncio.client.Pipeline.aclose() -> None
Alias for reset(), a standard method name for cleanup
methodredis.asyncio.client.Pipeline.execute(raise_on_error:bool=True) -> List[Any]
Execute all the commands in the current pipeline
methodredis.asyncio.client.Pipeline.unwatch()
Unwatches all previously specified keys
methodredis.asyncio.client.Pipeline.watch(*names:KeyT)
Watches the values at keys ``names``
methodredis.asyncio.client.PubSub.close() -> None
Alias for aclose(), for backwards compatibility
methodredis.asyncio.client.PubSub.connect()
Ensure that the PubSub is connected
methodredis.asyncio.client.PubSub.execute_command(*args:EncodableT)
Execute a publish/subscribe command
methodredis.asyncio.client.PubSub.handle_message(response, ignore_subscribe_messages=False)
Parses a pub/sub message.
methodredis.asyncio.client.PubSub.ping(message=None) -> Awaitable[bool]
Ping the Redis server to test connectivity.
methodredis.asyncio.client.PubSub.psubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to channel patterns.
methodredis.asyncio.client.PubSub.punsubscribe(*args:ChannelT) -> Awaitable
Unsubscribe from the supplied patterns.
methodredis.asyncio.client.PubSub.reset() -> None
Alias for aclose(), for backwards compatibility
methodredis.asyncio.client.PubSub.ssubscribe(*target_node:Any=None, *args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribes the client to the specified shard channels.
methodredis.asyncio.client.PubSub.subscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to channels.
methodredis.asyncio.client.PubSub.sunsubscribe(*target_node=None, *args) -> Awaitable
Unsubscribe from the supplied shard_channels.
methodredis.asyncio.client.PubSub.unsubscribe(*args) -> Awaitable
Unsubscribe from the supplied channels.
classredis.asyncio.client.Redis
Implementation of the Redis protocol.
methodredis.asyncio.client.Redis.close(close_connection_pool:Optional[bool]=None) -> None
Alias for aclose(), for backwards compatibility
methodredis.asyncio.client.Redis.execute_command(*args, **options)
Execute a command and return a parsed response
methodredis.asyncio.client.Redis.from_pool(connection_pool:ConnectionPool) -> 'Redis'
Return a Redis client from the given connection pool.
methodredis.asyncio.client.Redis.get_connection_kwargs()
Get the connection's key-word arguments
methodredis.asyncio.client.Redis.get_encoder()
Get the connection pool's encoder
methodredis.asyncio.client.Redis.himport_discard(fieldset_name:str) -> int
Remove a fieldset from the registry.
methodredis.asyncio.client.Redis.himport_discard_all() -> int
Remove all fieldsets from the registry.
methodredis.asyncio.client.Redis.himport_prepare(fieldset_name:str, fields:Iterable[FieldT]) -> bool
Declare an HIMPORT fieldset for use by :meth:`himport_set`.
methodredis.asyncio.client.Redis.pubsub(**kwargs) -> 'PubSub'
Return a Publish/Subscribe object.
methodredis.asyncio.client.Redis.set_response_callback(command:str, callback:ResponseCallbackT)
Set a custom Response Callback
classredis.asyncio.cluster.ClusterNode
Create a new ClusterNode.
methodredis.asyncio.cluster.ClusterNode.disconnect_free_connections() -> None
Disconnect all free/idle connections in the pool.
methodredis.asyncio.cluster.ClusterNode.disconnect_if_needed(connection:Connection) -> None
Disconnect a connection if it's marked for reconnect.
methodredis.asyncio.cluster.ClusterNode.release(connection:Connection) -> None
Release connection back to free queue.
classredis.asyncio.cluster.ClusterPipeline
Create a new ClusterPipeline object.
methodredis.asyncio.cluster.ClusterPipeline.execute(raise_on_error:bool=True, allow_redirections:bool=True) -> List[Any]
Execute the pipeline.
methodredis.asyncio.cluster.ClusterPipeline.execute_command(*args:Union[KeyT, EncodableT], **kwargs:Any) -> 'ClusterPipeline'
Append a raw command to the pipeline.
methodredis.asyncio.cluster.ClusterPipeline.nodes_manager() -> 'NodesManager'
Get the nodes manager from the cluster client.
methodredis.asyncio.cluster.ClusterPipeline.reset()
Reset back to empty pipeline.
methodredis.asyncio.cluster.ClusterPipeline.set_response_callback(command:str, callback:ResponseCallbackT) -> None
Set a custom response callback on the cluster client.
methodredis.asyncio.cluster.ClusterPipeline.watch(*names)
Watches the values at keys ``names``
classredis.asyncio.cluster.ClusterPubSub
Async cluster implementation for pub/sub.
methodredis.asyncio.cluster.ClusterPubSub.aclose() -> None
Disconnect the pubsub connection.
methodredis.asyncio.cluster.ClusterPubSub.execute_command(*args:Any, **kwargs:Any) -> Any
Execute a command on the appropriate cluster node.
methodredis.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.
methodredis.asyncio.cluster.ClusterPubSub.ssubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to shard channels.
methodredis.asyncio.cluster.ClusterPubSub.sunsubscribe(*args:Any) -> None
Unsubscribe from shard channels.
classredis.asyncio.cluster.RedisCluster
Create a new RedisCluster client.
methodredis.asyncio.cluster.RedisCluster.aclose() -> None
Close all connections & client if initialized.
methodredis.asyncio.cluster.RedisCluster.close() -> None
alias for aclose() for backwards compatibility
methodredis.asyncio.cluster.RedisCluster.from_url(url:str, **kwargs:Any) -> 'RedisCluster'
Return a Redis client object configured from the given URL.
methodredis.asyncio.cluster.RedisCluster.get_default_node() -> 'ClusterNode'
Get the default node of the client.
methodredis.asyncio.cluster.RedisCluster.get_encoder() -> Encoder
Get the encoder object of the client.
methodredis.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.
methodredis.asyncio.cluster.RedisCluster.get_node_from_key(key:str, replica:bool=False) -> Optional['ClusterNode']
Get the cluster node corresponding to the provided key.
methodredis.asyncio.cluster.RedisCluster.get_nodes() -> List['ClusterNode']
Get all nodes of the cluster.
methodredis.asyncio.cluster.RedisCluster.get_primaries() -> List['ClusterNode']
Get the primary nodes of the cluster.
methodredis.asyncio.cluster.RedisCluster.get_random_node() -> 'ClusterNode'
Get a random node of the cluster.
methodredis.asyncio.cluster.RedisCluster.get_random_primary_node() -> 'ClusterNode'
Returns a random primary node
methodredis.asyncio.cluster.RedisCluster.get_replicas() -> List['ClusterNode']
Get the replica nodes of the cluster.
methodredis.asyncio.cluster.RedisCluster.keyslot(key:EncodableT) -> int
Find the keyslot for a given key.
methodredis.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.
methodredis.asyncio.cluster.RedisCluster.set_default_node(node:'ClusterNode') -> None
Set the default node of the client.
methodredis.asyncio.cluster.RedisCluster.set_response_callback(command:str, callback:ResponseCallbackT) -> None
Set a custom response callback.
classredis.asyncio.connection.AbstractConnection
Manages communication to and from a Redis server
methodredis.asyncio.connection.AbstractConnection.disconnect(nowait:bool=False, error:Optional[Exception]=None, failure_count:Optional[int]=None, health_check_failed:bool=False) -> None
Disconnects from the Redis server
methodredis.asyncio.connection.AbstractConnection.getpeername() -> str | None
Returns the peer name of the connection.
methodredis.asyncio.connection.AbstractConnection.pack_command(*args:EncodableT) -> List[bytes]
Pack a series of arguments into the Redis protocol
methodredis.asyncio.connection.AbstractConnection.pack_commands(commands:Iterable[Iterable[EncodableT]]) -> List[bytes]
Pack multiple commands into the Redis protocol
methodredis.asyncio.connection.AbstractConnection.send_command(*args:Any, **kwargs:Any) -> None
Pack and send a command to the Redis server
classredis.asyncio.connection.Connection
Manages TCP communication to and from a Redis server
classredis.asyncio.connection.ConnectionPool
Create a connection pool.
methodredis.asyncio.connection.ConnectionPool.aclose() -> None
Close the pool, disconnecting all connections
methodredis.asyncio.connection.ConnectionPool.from_url(url:str, **kwargs) -> _CP
Return a connection pool configured from the given URL.
methodredis.asyncio.connection.ConnectionPool.make_connection()
Create a new connection.
methodredis.asyncio.connection.ConnectionPool.release(connection:AbstractConnection)
Releases the connection back to the pool
classredis.asyncio.connection.SSLConnection
Manages SSL connections to and from the Redis server(s).
classredis.asyncio.connection.UnixDomainSocketConnection
Manages UDS communication to and from a Redis server
classredis.asyncio.lock.Lock
A shared, distributed Lock.
methodredis.asyncio.lock.Lock.extend(additional_time:Number, replace_ttl:bool=False) -> Awaitable[Literal[True]]
Adds more time to an already acquired lock.
methodredis.asyncio.lock.Lock.release() -> None
Releases the already acquired lock.
classredis.asyncio.multidb.client.MultiDBClient
Client that operates on multiple logical Redis databases.
methodredis.asyncio.multidb.client.MultiDBClient.add_health_check(healthcheck:HealthCheck)
Adds a new health check to the database.
methodredis.asyncio.multidb.client.MultiDBClient.get_databases() -> Databases
Returns a sorted (by weight) list of all databases.
methodredis.asyncio.multidb.client.MultiDBClient.pubsub(**kwargs)
Return a Publish/Subscribe object.
methodredis.asyncio.multidb.client.MultiDBClient.set_active_database(database:AsyncDatabase) -> None
Promote one of the existing databases to become an active.
methodredis.asyncio.multidb.client.Pipeline.aclose() -> None
Close the pipeline
methodredis.asyncio.multidb.client.Pipeline.execute() -> List[Any]
Execute all the commands in the current pipeline
methodredis.asyncio.multidb.client.Pipeline.execute_command(*args, **kwargs)
Adds a command to the stack
classredis.asyncio.multidb.client.PubSub
PubSub object for multi database client.
methodredis.asyncio.multidb.client.PubSub.psubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to channel patterns.
methodredis.asyncio.multidb.client.PubSub.punsubscribe(*args:ChannelT)
Unsubscribe from the supplied patterns.
methodredis.asyncio.multidb.client.PubSub.run(*exception_handler=None, *poll_timeout:float=1.0) -> None
Process pub/sub messages using registered callbacks.
methodredis.asyncio.multidb.client.PubSub.subscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to channels.
classredis.asyncio.multidb.database.AsyncDatabase
Database with an underlying asynchronous redis client.
methodredis.asyncio.multidb.database.AsyncDatabase.circuit() -> CircuitBreaker
Circuit breaker for the current database.
methodredis.asyncio.multidb.database.AsyncDatabase.client() -> Union[Redis, RedisCluster]
The underlying redis client.
classredis.asyncio.multidb.event.CloseConnectionOnActiveDatabaseChanged
Close connection to the old active database.
classredis.asyncio.multidb.failover.DefaultFailoverStrategyExecutor
Executes given failover strategy.
classredis.asyncio.multidb.failover.WeightBasedFailoverStrategy
Failover strategy based on database weights.
classredis.asyncio.multidb.failure_detector.FailureDetectorAsyncWrapper
Async wrapper for the failure detector.
classredis.asyncio.multidb.healthcheck.AbstractHealthCheckPolicy
Abstract health check policy.
methodredis.asyncio.multidb.healthcheck.AbstractHealthCheckPolicy.close() -> None
Close all health check clients.
classredis.asyncio.multidb.healthcheck.HealthCheck
Health check interface.
methodredis.asyncio.multidb.healthcheck.HealthCheck.check_health(database, hc_client:AsyncRedisClientT) -> bool
Function to determine the health status.
methodredis.asyncio.multidb.healthcheck.HealthCheck.health_check_delay() -> float
Delay between health check probes.
methodredis.asyncio.multidb.healthcheck.HealthCheck.health_check_probes() -> int
Number of probes to execute health checks.
classredis.asyncio.multidb.healthcheck.HealthCheckPolicy
Health checks execution policy.
methodredis.asyncio.multidb.healthcheck.HealthCheckPolicy.close() -> None
Close all health check clients.
methodredis.asyncio.multidb.healthcheck.HealthCheckPolicy.get_client(database) -> AsyncRedisClientT
Get a health check client for the database.
methodredis.asyncio.multidb.healthcheck.LagAwareHealthCheck.check_health(database, hc_client:AsyncRedisClientT) -> bool
Check database health via Redis Enterprise REST API.
classredis.asyncio.multidb.healthcheck.PingHealthCheck
Health check based on PING command.
funcredis.asyncio.observability.recorder.is_enabled() -> bool
Check if observability is enabled.
funcredis.asyncio.observability.recorder.record_connection_closed(close_reason:Optional[CloseReason]=None, error_type:Optional[Exception]=None) -> None
Record a connection closed event.
funcredis.asyncio.observability.recorder.record_connection_count(pool_name:str, connection_state:ConnectionState, counter:int=1) -> None
Record a connection count change for a single state.
funcredis.asyncio.observability.recorder.record_connection_create_time(connection_pool:'ConnectionPool', duration_seconds:float) -> None
Record connection creation time.
funcredis.asyncio.observability.recorder.record_connection_relaxed_timeout(connection_name:str, maint_notification:str, relaxed:bool) -> None
Record a connection timeout relaxation event.
funcredis.asyncio.observability.recorder.record_connection_timeout(pool_name:str) -> None
Record a connection timeout event.
funcredis.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) -> None
Record error count.
funcredis.asyncio.observability.recorder.record_geo_failover(fail_from:'AsyncDatabase', fail_to:'AsyncDatabase', reason:GeoFailoverReason) -> None
Record a geo failover.
funcredis.asyncio.observability.recorder.record_pubsub_message(direction:PubSubDirection, channel:Optional[str]=None, sharded:Optional[bool]=None) -> None
Record a PubSub message (published or received).
funcredis.asyncio.observability.recorder.record_streaming_lag(lag_seconds:float, stream_name:Optional[str]=None, consumer_group:Optional[str]=None) -> None
Record the lag of a streaming message.
methodredis.asyncio.sentinel.Sentinel.discover_slaves(service_name:str) -> Sequence[Tuple[EncodableT, EncodableT]]
Returns a list of alive slaves for service ``service_name``
methodredis.asyncio.sentinel.Sentinel.filter_replicas(replicas:Iterable[Mapping]) -> Sequence[Tuple[EncodableT, EncodableT]]
Remove replicas that are in an ODOWN or SDOWN state.
methodredis.asyncio.sentinel.Sentinel.filter_slaves(slaves:Iterable[Mapping]) -> Sequence[Tuple[EncodableT, EncodableT]]
Remove slaves that are in an ODOWN or SDOWN state
classredis.asyncio.sentinel.SentinelConnectionPool
Sentinel backed connection pool.
methodredis.asyncio.sentinel.SentinelConnectionPool.rotate_replicas() -> AsyncIterator
Round-robin replica balancer.
methodredis.asyncio.sentinel.SentinelConnectionPool.rotate_slaves() -> AsyncIterator
Round-robin slave balancer
funcredis.asyncio.utils.from_url(url:str, **kwargs:Any) -> 'Redis'
Returns an active Redis client generated from the given database URL.
classredis.auth.err.InvalidTokenSchemaErr
Represents an exception related to invalid token schema.
classredis.auth.err.RequestTokenErr
Represents an exception during token request.
classredis.auth.err.TokenRenewalErr
Represents an exception during token renewal process.
classredis.auth.idp.IdentityProviderInterface
Receive a token from the identity provider.
methodredis.auth.token_manager.RetryPolicy.get_delay_in_ms() -> float
Delay between retries in seconds.
methodredis.auth.token_manager.RetryPolicy.get_max_attempts() -> int
Retry attempts before exception will be thrown.
funcredis.background.BackgroundScheduler.on_complete(future:asyncio.Future)
Log any exceptions from the coroutine.
classredis.backoff.AbstractBackoff
Backoff interface
methodredis.backoff.AbstractBackoff.compute(failures:int) -> float
Compute backoff in seconds upon failure
classredis.backoff.ConstantBackoff
Constant backoff upon failure
classredis.backoff.DecorrelatedJitterBackoff
Decorrelated jitter backoff upon failure
classredis.backoff.EqualJitterBackoff
Equal jitter backoff upon failure
classredis.backoff.ExponentialBackoff
Exponential backoff upon failure
classredis.backoff.ExponentialWithJitterBackoff
Exponential backoff upon failure, with jitter
classredis.backoff.FullJitterBackoff
Full jitter backoff upon failure
classredis.backoff.NoBackoff
No backoff upon failure
classredis.cache.CacheKey
Represents a unique key for a cache entry.
classredis.client.CaseInsensitiveDict
Case insensitive dict implementation.
methodredis.client.Monitor.listen()
Listen for commands coming to the server.
methodredis.client.Monitor.next_command()
Parse the response from a monitor command
methodredis.client.Pipeline.close() -> None
Close the pipeline
methodredis.client.Pipeline.execute(raise_on_error:bool=True) -> List[Any]
Execute all the commands in the current pipeline
methodredis.client.Pipeline.unwatch() -> bool
Unwatches all previously specified keys
methodredis.client.Pipeline.watch(*names)
Watches the values at keys ``names``
methodredis.client.PubSub.clean_health_check_responses() -> None
If any health check responses are present, clean them
methodredis.client.PubSub.execute_command(*args)
Execute a publish/subscribe command
methodredis.client.PubSub.handle_message(response, ignore_subscribe_messages=False)
Parses a pub/sub message.
methodredis.client.PubSub.is_health_check_response(response) -> bool
Check if the response is a health check response.
methodredis.client.PubSub.ping(message:Union[str, None]=None) -> bool
Ping the Redis server to test connectivity.
methodredis.client.PubSub.psubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to channel patterns.
methodredis.client.PubSub.punsubscribe(*args)
Unsubscribe from the supplied patterns.
methodredis.client.PubSub.ssubscribe(*target_node:Any=None, *args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribes the client to the specified shard channels.
methodredis.client.PubSub.subscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to channels.
methodredis.client.PubSub.unsubscribe(*args)
Unsubscribe from the supplied channels.
classredis.client.Redis
Implementation of the Redis protocol.
methodredis.client.Redis.from_pool(connection_pool:ConnectionPool) -> 'Redis'
Return a Redis client from the given connection pool.
methodredis.client.Redis.get_connection_kwargs() -> Dict
Get the connection's key-word arguments
methodredis.client.Redis.get_encoder() -> 'Encoder'
Get the connection pool's encoder
methodredis.client.Redis.himport_discard(fieldset_name:str) -> int
Remove a fieldset from the registry.
methodredis.client.Redis.himport_discard_all() -> int
Remove all fieldsets from the registry.
methodredis.client.Redis.himport_prepare(fieldset_name:str, fields:Iterable[FieldT]) -> bool
Declare an HIMPORT fieldset for use by :meth:`himport_set`.
methodredis.client.Redis.pubsub(**kwargs)
Return a Publish/Subscribe object.
methodredis.client.Redis.set_response_callback(command:str, callback:Callable) -> None
Set a custom Response Callback
classredis.cluster.ClusterPipeline
Support for Redis pipeline in cluster mode
methodredis.cluster.ClusterPipeline.execute(raise_on_error:bool=True) -> List[Any]
Execute all the commands in the current pipeline
methodredis.cluster.ClusterPipeline.reset()
Reset back to empty pipeline.
methodredis.cluster.ClusterPipeline.unwatch()
Unwatches all previously specified keys
methodredis.cluster.ClusterPipeline.watch(*names)
Watches the values at keys ``names``
classredis.cluster.ClusterPubSub
Wrapper for PubSub class.
methodredis.cluster.ClusterPubSub.disconnect()
Disconnect the pubsub connection.
methodredis.cluster.ClusterPubSub.ssubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to shard channels.
classredis.cluster.LoadBalancer
Round-Robin Load Balancing
methodredis.cluster.RedisCluster.determine_slot(*args) -> Optional[int]
Figure out what slot to use based on args.
methodredis.cluster.RedisCluster.get_default_node()
Get the cluster's default node
methodredis.cluster.RedisCluster.get_encoder()
Get the connections' encoder
methodredis.cluster.RedisCluster.get_random_primary_node() -> 'ClusterNode'
Returns a random primary node
methodredis.cluster.RedisCluster.keyslot(key)
Calculate keyslot for a given key.
methodredis.cluster.RedisCluster.set_default_node(node)
Set the default node of the cluster.
methodredis.cluster.RedisCluster.set_response_callback(command, callback)
Set a custom Response Callback
funcredis.cluster.parse_cluster_myshardid(resp, **options)
Parse CLUSTER MYSHARDID response.
funcredis.cluster.parse_cluster_shards(resp, **options)
Parse CLUSTER SHARDS response.
classredis.commands.bf.commands.BFCommands
Bloom Filter commands.
classredis.commands.bf.commands.CFCommands
Cuckoo Filter commands.
classredis.commands.bf.commands.CMSCommands
Count-Min Sketch Commands
classredis.commands.bf.commands.TOPKCommands
TOP-k Filter commands.
methodredis.commands.cluster.AsyncClusterMultiKeyCommands.mset_nonatomic(mapping:Mapping[AnyKeyT, EncodableT]) -> List[bool]
Sets key/values based on a mapping.
classredis.commands.cluster.ClusterMultiKeyCommands
A class containing commands that handle more than one key
methodredis.commands.cluster.ClusterMultiKeyCommands.mset_nonatomic(mapping:Mapping[AnyKeyT, EncodableT]) -> List[bool]
Sets key/values based on a mapping.
classredis.commands.json.ClusterPipeline
Cluster pipeline for the module.
classredis.commands.json.Pipeline
Pipeline for the module.
classredis.commands.json.commands.JSONCommands
json commands.
classredis.commands.json.path.Path
This class represents a path in a JSON value.
classredis.commands.policies.AsyncBasePolicyResolver
Async base class for policy resolvers.
classredis.commands.policies.AsyncDynamicPolicyResolver
Async version of DynamicPolicyResolver.
classredis.commands.policies.AsyncStaticPolicyResolver
Async version of StaticPolicyResolver.
classredis.commands.policies.BasePolicyResolver
Base class for policy resolvers.
classredis.commands.policies.DynamicPolicyResolver
Resolves policy dynamically based on the COMMAND output.
classredis.commands.policies.StaticPolicyResolver
Resolves policy from a static list of policy records.
classredis.commands.search.AsyncPipeline
AsyncPipeline for the module.
classredis.commands.search.Pipeline
Pipeline for the module.
classredis.commands.search.Search
Create a client for talking to search.
classredis.commands.search.aggregation.Reducer
Base reducer object for all reducers.
methodredis.commands.search.aggregation.Reducer.alias(alias:str) -> 'Reducer'
Set the alias for this reducer.
classredis.commands.search.aggregation.SortDirection
This special class is used to indicate sort direction.
classredis.commands.search.commands.SearchCommands
Search commands.
methodredis.commands.search.commands.SearchCommands.config_get(option:str) -> str
Get runtime configuration option value.
methodredis.commands.search.commands.SearchCommands.config_set(option:str, value:str) -> bool
Set runtime configuration option.
methodredis.commands.search.commands.SearchCommands.dict_add(name:str, *terms:List[str])
Adds terms to a dictionary.
methodredis.commands.search.commands.SearchCommands.dict_del(name:str, *terms:List[str])
Deletes terms from a dictionary.
methodredis.commands.search.commands.SearchCommands.dict_dump(name:str)
Dumps all terms in the given dictionary.
methodredis.commands.search.commands.SearchCommands.dropindex(delete_documents:bool=False)
Drop the index if it exists.
methodredis.commands.search.commands.SearchCommands.sugdel(key:str, string:str) -> int
Delete a string from the AutoCompleter index.
methodredis.commands.search.commands.SearchCommands.suglen(key:str) -> int
Return the number of entries in the AutoCompleter index.
methodredis.commands.search.commands.SearchCommands.synupdate(groupid:str, skipinitial:bool=False, *terms:List[str])
Updates a synonym group.
classredis.commands.search.document.Document
Represents a single document in a result set
classredis.commands.search.field.Field
A class representing a field in a document.
classredis.commands.search.index_definition.IndexType
Enum of the currently supported index types.
classredis.commands.search.profile_information.ProfileInformation
Wrapper around FT.PROFILE response
methodredis.commands.search.query.Query.add_filter(flt:'Filter') -> 'Query'
Add a numeric or geo filter to the query.
methodredis.commands.search.query.Query.dialect(dialect:int) -> 'Query'
Add a dialect field to the query.
methodredis.commands.search.query.Query.expander(expander:str) -> 'Query'
Add an expander field to the query.
methodredis.commands.search.query.Query.language(language:str) -> 'Query'
Analyze the query as being in the specified language.
methodredis.commands.search.query.Query.limit_fields(*fields:str) -> 'Query'
Limit the search to specific TEXT fields only.
methodredis.commands.search.query.Query.no_stopwords() -> 'Query'
Prevent the query from being filtered for stopwords.
methodredis.commands.search.query.Query.paging(offset:int, num:int) -> 'Query'
Set the paging for the query (defaults to 0..10).
methodredis.commands.search.query.Query.query_string() -> str
Return the query string of this query only.
methodredis.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.
methodredis.commands.search.query.Query.return_fields(*fields) -> 'Query'
Add fields to return fields.
methodredis.commands.search.query.Query.scorer(scorer:str) -> 'Query'
Use a different scoring function to evaluate document relevance.
methodredis.commands.search.query.Query.sort_by(field:str, asc:bool=True) -> 'Query'
Add a sortby field to the query.
methodredis.commands.search.query.Query.timeout(timeout:float) -> 'Query'
overrides the timeout parameter of the module
methodredis.commands.search.query.Query.with_payloads() -> 'Query'
Ask the engine to return document payloads.
methodredis.commands.search.query.Query.with_scores() -> 'Query'
Ask the engine to return document search scores.
classredis.commands.search.querystring.DisjunctNode
Create a disjunct node.
classredis.commands.search.querystring.DistjunctUnion
This node is true if *all* of its children are false.
classredis.commands.search.querystring.IntersectNode
Create an intersection node.
classredis.commands.search.querystring.OptionalNode
Create an optional node.
classredis.commands.search.querystring.UnionNode
Create a union node.
funcredis.commands.search.querystring.between(a, b, inclusive_min=True, inclusive_max=True)
Indicate that value is a numeric range
funcredis.commands.search.querystring.equal(n)
Match a numeric value
funcredis.commands.search.querystring.ge(n)
Match any value greater or equal to n
funcredis.commands.search.querystring.gt(n)
Match any value greater than n
funcredis.commands.search.querystring.le(n)
Match any value less or equal to n
funcredis.commands.search.querystring.lt(n)
Match any value less than n
classredis.commands.search.reducers.avg
Calculates the mean value in the given field within the group
classredis.commands.search.reducers.count
Counts the number of results in the group
classredis.commands.search.reducers.tolist
Returns all the matched properties in a list
methodredis.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.
classredis.commands.sentinel.SentinelCommands
A class containing the commands specific to redis sentinel.
methodredis.commands.sentinel.SentinelCommands.sentinel(*args)
Redis Sentinel's SENTINEL command.
classredis.commands.timeseries.ClusterPipeline
Cluster pipeline for the module.
classredis.commands.timeseries.Pipeline
Pipeline for the module.
classredis.commands.timeseries.commands.TimeSeriesCommands
RedisTimeSeries Commands.
classredis.commands.timeseries.info.TSInfo
Hold information and statistics on the time-series.
funcredis.commands.timeseries.utils.parse_get(response)
Parse get response.
funcredis.commands.timeseries.utils.parse_get_unified(response, **kwargs)
Unified parser for TS.GET.
funcredis.commands.timeseries.utils.parse_m_get_unified(response, **kwargs)
Unified parser for TS.MGET.
funcredis.commands.timeseries.utils.parse_range(response, **kwargs)
Parse range response.
classredis.commands.vectorset.AsyncVectorSet
Async VectorSet client.
classredis.commands.vectorset.VectorSet
Sync VectorSet client.
classredis.commands.vectorset.commands.CallbacksOptions
Options that can be set for the commands callbacks
classredis.commands.vectorset.commands.QuantizationOptions
Quantization options for the VADD command.
classredis.commands.vectorset.commands.VectorSetCommands
Redis VectorSet commands
classredis.connection.AbstractConnection
Manages communication to and from a Redis server
methodredis.connection.AbstractConnection.can_read(timeout:float=0) -> bool
Poll the socket to see if there's data that can be read.
methodredis.connection.AbstractConnection.disconnect(*args, **kwargs)
Disconnects from the Redis server
classredis.connection.Connection
Manages TCP communication to and from a Redis server
classredis.connection.ConnectionPool
Create a connection pool.
methodredis.connection.ConnectionPool.close() -> None
Close the pool, disconnecting all connections
methodredis.connection.ConnectionPool.from_url(url:str, **kwargs) -> _CP
Return a connection pool configured from the given URL.
methodredis.connection.ConnectionPool.get_connection(command_name=None, *keys, **options) -> 'Connection'
Get a connection from the pool
methodredis.connection.ConnectionPool.get_encoder() -> Encoder
Return an encoder based on encoding settings
methodredis.connection.ConnectionPool.make_connection() -> 'ConnectionInterface'
Create a new connection
methodredis.connection.ConnectionPool.release(connection:'Connection') -> None
Releases the connection back to the pool
classredis.connection.SSLConnection
Manages SSL connections to and from the Redis server(s).
classredis.connection.UnixDomainSocketConnection
Manages UDS communication to and from a Redis server
funcredis.crc.key_slot(key:EncodedT, bucket:int=REDIS_CLUSTER_HASH_SLOTS) -> int
Calculate key slot for a given key.
classredis.credentials.CredentialProvider
Credentials Provider.
classredis.data_structure.WeightedList
Thread-safe weighted list.
methodredis.data_structure.WeightedList.add(item:Any, weight:float) -> None
Add item with weight, maintaining sorted order
methodredis.data_structure.WeightedList.get_by_weight_range(min_weight:float, max_weight:float) -> List[tuple[Any, Number]]
Get all items within weight range
methodredis.data_structure.WeightedList.get_top_n(n:int) -> List[tuple[Any, Number]]
Get top N the highest weighted items
methodredis.data_structure.WeightedList.remove(item)
Remove first occurrence of item
methodredis.driver_info.DriverInfo.add_upstream_driver(driver_name:str, driver_version:str) -> 'DriverInfo'
Add an upstream driver to this instance and return self.
methodredis.driver_info.DriverInfo.upstream_drivers() -> List[str]
Return a copy of the upstream driver entries.
funcredis.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.
classredis.event.AfterConnectionReleasedEvent
Event that will be fired before each command execution.
classredis.event.AsyncEventListenerInterface
Represents an async listener for given event object.
classredis.event.EventListenerInterface
Represents a listener for given event object.
classredis.event.OnCommandsFailEvent
Event fired whenever a command fails during the execution.
classredis.exceptions.AskError
Error indicated ASK error received from cluster.
classredis.exceptions.ClusterCrossSlotError
Error indicated CROSSSLOT error received from cluster.
classredis.exceptions.ClusterDownError
Error indicated CLUSTERDOWN error received from cluster.
classredis.exceptions.InvalidPipelineStack
Raised on unexpected response length on pipelines.
classredis.exceptions.LockError
Errors acquiring or releasing a lock
classredis.exceptions.MasterDownError
Error indicated MASTERDOWN error received from cluster.
classredis.exceptions.MovedError
Error indicated MOVED error received from cluster.
classredis.exceptions.OutOfMemoryError
Indicates the database is full.
classredis.exceptions.RedisClusterException
Base exception for the RedisCluster client
classredis.exceptions.TryAgainError
Error indicated TRYAGAIN error received from cluster.
classredis.himport.HImportFieldset
An immutable HIMPORT fieldset entry.
classredis.himport.HImportRegistry
Client-level registry of HIMPORT fieldsets.
methodredis.himport.HImportRegistry.discard(name:str) -> bool
Remove a fieldset from the registry.
methodredis.himport.HImportRegistry.discard_all() -> int
Remove all fieldsets and return the number removed.
methodredis.himport.HImportRegistry.get(name:str) -> HImportFieldset | None
Return the fieldset registered under ``name``, or ``None``.
methodredis.himport.HImportRegistry.items() -> list[tuple[str, HImportFieldset]]
Return a snapshot of ``(name, fieldset)`` pairs.
methodredis.himport.HImportRegistry.names() -> list[str]
Return the registered fieldset names.
methodredis.himport.HImportRegistry.names_to_discard(prepared_names:Iterable[str]) -> list[str]
Return which of ``prepared_names`` are no longer registered.
funcredis.himport.himport_discard_command(fieldset_name:str) -> tuple
Positional wire args for ``HIMPORT DISCARD fieldset_name``.
classredis.http.http_client.HttpClient
A lightweight HTTP client for REST API calls.
classredis.keyspace_notifications.EventType
Common Redis keyspace notification event type constants.
classredis.keyspace_notifications.KeyspaceNotificationsInterface
Interface for keyspace notification managers.
classredis.keyspace_notifications.KeyspaceWorkerThread
Background thread for processing keyspace notifications.
methodredis.keyspace_notifications.KeyspaceWorkerThread.stop() -> None
Stop the worker thread.
funcredis.keyspace_notifications.get_channel_type(channel:str | bytes) -> ChannelType | None
Determine the type of a Redis keyspace notification channel.
classredis.lock.Lock
A shared, distributed Lock.
methodredis.lock.Lock.extend(additional_time:Number, replace_ttl:bool=False) -> Literal[True]
Adds more time to an already acquired lock.
methodredis.lock.Lock.owned() -> bool
Returns True if this key is locked by this lock, otherwise False.
methodredis.lock.Lock.release() -> None
Releases the already acquired lock
classredis.multidb.circuit.BaseCircuitBreaker
Base implementation of Circuit Breaker interface.
classredis.multidb.client.MultiDBClient
Client that operates on multiple logical Redis databases.
methodredis.multidb.client.MultiDBClient.add_health_check(healthcheck:HealthCheck)
Adds a new health check to the database.
methodredis.multidb.client.MultiDBClient.close()
Closes the client and all its resources.
methodredis.multidb.client.MultiDBClient.get_databases() -> Databases
Returns a sorted (by weight) list of all databases.
methodredis.multidb.client.MultiDBClient.pubsub(**kwargs)
Return a Publish/Subscribe object.
methodredis.multidb.client.MultiDBClient.remove_database(database:Database)
Removes a database from the database list.
methodredis.multidb.client.MultiDBClient.set_active_database(database:SyncDatabase) -> None
Promote one of the existing databases to become an active.
methodredis.multidb.client.MultiDBClient.transaction(func:Callable[['Pipeline'], None], *watches, **options)
Executes callable as transaction.
classredis.multidb.client.Pipeline
Pipeline implementation for multiple logical Redis databases.
methodredis.multidb.client.Pipeline.close() -> None
Close the pipeline
methodredis.multidb.client.Pipeline.execute() -> List[Any]
Execute all the commands in the current pipeline
methodredis.multidb.client.Pipeline.execute_command(*args, **kwargs)
Adds a command to the stack
classredis.multidb.client.PubSub
PubSub object for multi database client.
methodredis.multidb.client.PubSub.psubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to channel patterns.
methodredis.multidb.client.PubSub.ssubscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribes the client to the specified shard channels.
methodredis.multidb.client.PubSub.subscribe(*args:ChannelT | Subscription, **kwargs:PubSubHandler) -> None
Subscribe to channels.
classredis.multidb.database.SyncDatabase
Database with an underlying synchronous redis client.
methodredis.multidb.database.SyncDatabase.circuit() -> CircuitBreaker
Circuit breaker for the current database.
methodredis.multidb.database.SyncDatabase.client() -> Union[redis.Redis, RedisCluster]
The underlying redis client.
classredis.multidb.event.ActiveDatabaseChanged
Event fired when an active database has been changed.
classredis.multidb.event.CloseConnectionOnActiveDatabaseChanged
Close connection to the old active database.
classredis.multidb.exception.InitialHealthCheckFailedError
Exception raised when initial health check fails.
classredis.multidb.failover.DefaultFailoverStrategyExecutor
Executes given failover strategy.
classredis.multidb.failover.WeightBasedFailoverStrategy
Failover strategy based on database weights.
classredis.observability.config.MetricGroup
Metric groups that can be enabled/disabled.
classredis.observability.config.OTelConfig
Configuration for OpenTelemetry observability in redis-py.
methodredis.observability.config.OTelConfig.is_enabled() -> bool
Check if any observability feature is enabled.
classredis.observability.config.TelemetryOption
Telemetry options to export.
classredis.observability.providers.OTelProviderManager
Manages OpenTelemetry SDK providers and their lifecycle.
methodredis.observability.providers.OTelProviderManager.force_flush(timeout_millis:int=30000) -> bool
Force flush any pending metrics from the global MeterProvider.
methodredis.observability.providers.OTelProviderManager.shutdown(timeout_millis:int=30000) -> bool
Shutdown observability and flush any pending metrics.
methodredis.observability.providers.ObservabilityInstance.force_flush(timeout_millis:int=30000) -> bool
Force flush all pending metrics immediately.
methodredis.observability.providers.ObservabilityInstance.get_provider_manager() -> Optional[OTelProviderManager]
Get the provider manager instance.
methodredis.observability.providers.ObservabilityInstance.is_enabled() -> bool
Check if observability is enabled.
methodredis.observability.providers.ObservabilityInstance.shutdown(timeout_millis:int=30000) -> bool
Shutdown observability and flush any pending metrics.
funcredis.observability.providers.reset_observability_instance() -> None
Reset the global observability singleton instance.
funcredis.observability.recorder.init_csc_items() -> None
Initialize observable gauge for CSC items metric.
funcredis.observability.recorder.is_enabled() -> bool
Check if observability is enabled.
funcredis.observability.recorder.record_connection_closed(close_reason:Optional[CloseReason]=None, error_type:Optional[Exception]=None) -> None
Record a connection closed event.
funcredis.observability.recorder.record_connection_count(pool_name:str, connection_state:ConnectionState, counter:int=1) -> None
Record a connection count change for a single state.
funcredis.observability.recorder.record_connection_create_time(connection_pool:'ConnectionPoolInterface', duration_seconds:float) -> None
Record connection creation time.
funcredis.observability.recorder.record_connection_relaxed_timeout(connection_name:str, maint_notification:str, relaxed:bool) -> None
Record a connection timeout relaxation event.
funcredis.observability.recorder.record_connection_timeout(pool_name:str) -> None
Record a connection timeout event.
funcredis.observability.recorder.record_connection_wait_time(pool_name:str, duration_seconds:float) -> None
Record time taken to obtain a connection from the pool.
funcredis.observability.recorder.record_csc_eviction(count:int, reason:Optional[CSCReason]=None) -> None
Record a Client Side Caching (CSC) eviction.
funcredis.observability.recorder.record_geo_failover(fail_from:'SyncDatabase', fail_to:'SyncDatabase', reason:GeoFailoverReason) -> None
Record a geo failover.
funcredis.observability.recorder.record_maint_notification_count(server_address:str, server_port:int, network_peer_address:str, network_peer_port:int, maint_notification:str) -> None
Record a maintenance notification count.
funcredis.observability.recorder.record_pubsub_message(direction:PubSubDirection, channel:Optional[str]=None, sharded:Optional[bool]=None) -> None
Record a PubSub message (published or received).
funcredis.observability.recorder.record_streaming_lag(lag_seconds:float, stream_name:Optional[str]=None, consumer_group:Optional[str]=None, consumer_name:Optional[str]=None) -> None
Record the lag of a streaming message.
funcredis.observability.recorder.register_csc_items_callback(callback:Callable, pool_name:Optional[str]=None) -> None
Adds given callback to CSC items observable registry.
methodredis.observability.registry.ObservablesRegistry.clear() -> None
Clear the registry.
methodredis.observability.registry.ObservablesRegistry.get(name:str) -> List[Callable[[], List[Any]]]
Get all callbacks for an observable metric.
methodredis.observability.registry.ObservablesRegistry.register(name:str, callback:Callable[[], List[Any]]) -> None
Register a callback for an observable metric.
classredis.ocsp.OCSPVerifier
A class to verify ssl sockets for RFC6960/RFC6961.
methodredis.ocsp.OCSPVerifier.build_certificate_url(server, cert, issuer_cert)
Return the complete url to the ocsp
classredis.retry.AbstractRetry
Retry a specific number of times after a failure
methodredis.retry.AbstractRetry.get_retries() -> int
Get the number of retries.
methodredis.retry.AbstractRetry.update_retries(value:int) -> None
Set the number of retries.
methodredis.retry.AbstractRetry.update_supported_errors(specified_errors:Iterable[Type[E]]) -> None
Updates the supported errors with the specified error types
classredis.sentinel.SentinelConnectionPool
Sentinel backed connection pool.
methodredis.sentinel.SentinelConnectionPool.rotate_replicas()
Round-robin replica balancer.
methodredis.sentinel.SentinelConnectionPool.rotate_slaves()
Round-robin slave balancer

この情報について

掲載しているシグネチャは redis/redis-py の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る