Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
Python Redis libraries connect applications to Redis, the in-memory key-value store, to read and write keys and run its commands. Higher-level libraries map Python containers and object models onto Redis keys rather than exposing raw commands. These libraries let web apps, task workers, and AI agents share cached data across processes.
Popularity
redis-py has the most monthly downloads in this comparison, at 247.7M.
def set_many(self, data, timeout):
client = self.get_client(None, write=True)
pipeline = client.pipeline()
pipeline.mset({k: self._serializer.dumps(v) for k, v in data.items()})
if timeout is not None:
# Setting timeout for each key as redis does not support timeout # with mset(). for key in data:
pipeline.expire(key, timeout)
pipeline.execute()
async def read_response(
self, disable_decoding: bool = False, push_request: bool = False
) -> Union[EncodableT, List[EncodableT]]:
while True:
# If `on_disconnect()` has been called, prohibit any more reads # even if they could happen because data might be present. # We still allow reads in progress to finish if not self._connected:
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None
if disable_decoding:
response = self._reader.gets(False)
else:
response = self._reader.gets()
while response is NOT_ENOUGH_DATA:
await self.read_from_socket()
if disable_decoding:
response = self._reader.gets(False)
else:
response = self._reader.gets()
if self._hiredis_PushNotificationType is None or not isinstance(
response, self._hiredis_PushNotificationType
):
break
response = await self.handle_push_response(response)
if push_request:
return response
# Otherwise read the reply the push interleaved with. Looping # instead of recursing keeps a burst of consecutive push frames # from growing the stack. # if the response is a ConnectionError or the response is a list and # the first item is a ConnectionError, raise it as something bad # happened if isinstance(response, ConnectionError):
raise response
elif (
isinstance(response, list)
and response
and isinstance(response[0], ConnectionError)
):
raise response[0]
return response
coredis
Provides an asynchronous typed Redis client with cluster and Sentinel support.
Downloads / mo
2.5M
Stars
118
Last release
6.9.0
License
MIT
Strengths
Uses native asynchronous call sites.Await Redis commands in an asynchronous application.
Connects to clusters and Sentinel.Use the RedisCluster and Sentinel client interfaces.
Limitations
Requires asynchronous call sites.Await commands instead of using a blocking client interface.
from redis_om import HashModel
class Customer(HashModel):
first_name: str
customer = Customer(first_name='Andrew')
customer.save()
FAQ
redis-py suits most applications, with synchronous and asynchronous clients and atomic transactions. coredis suits async code that wants a typed client with cluster and Sentinel support. Fakeredis suits tests that need the Redis API without a server.
redis-py is the Python client for the Redis database and key-value store. It provides synchronous and asynchronous clients and groups commands into atomic transactions.
hiredis is a Python wrapper for the hiredis parser. It reads Redis protocol replies from byte streams and does no network I/O of its own.
RedisVL is a Python client library and CLI for using Redis as a vector database.
No. A redis-py Pipeline or PubSub object should stay in the thread that created it.
For coding agents
Found your Redis library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.