The official Python client library for Redis, providing comprehensive access to Redis key-value store functionality.
redis-py is the official Python client library for Redis, providing a comprehensive interface to interact with Redis key-value databases from Python applications. It implements all Redis commands, supports advanced features like pipelining and pub/sub, and includes connection pooling for efficient resource management. The library solves the problem of Python applications needing reliable, feature-complete access to Redis functionality.
Python developers building applications that use Redis for caching, messaging, real-time features, or as a primary data store. This includes web developers, data engineers, and backend system architects working with Python stacks.
Developers choose redis-py because it's the official, maintained Python client with complete Redis command support, excellent documentation, and production-ready features like connection pooling and Active-Active failover. Its Pythonic API design and optional hiredis integration provide both developer convenience and performance optimization.
Redis Python client
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements all Redis commands with Pythonic interfaces, following official syntax, as shown in the README's support for out-of-the-box commands and dedicated command modules.
Automatically manages connections for efficiency, with examples for custom pools in the usage section, reducing resource overhead in production applications.
Optional hiredis integration provides a compiled response parser for significantly faster performance, requiring zero code changes in most cases, as highlighted in the installation instructions.
Includes pipelining, pub/sub, and RESP3 protocol support with dedicated classes like Pipeline and PubSub, enabling complex use cases like batch operations and real-time messaging.
Multi-database client with automatic health monitoring and failover, designed for Redis Cloud Active-Active setups, as detailed in the advanced topics for high-availability deployments.
The PubSub class places the connection in a state where non-pubsub commands can't be executed, requiring separate clients for publishing, as noted in the advanced topics section.
Optimal performance requires installing the optional hiredis package, adding a compiled dependency and setup step, which might complicate deployments in constrained environments.
Newer releases drop support for older Python versions (e.g., 3.7 and 3.8), forcing upgrades in legacy systems, as warned in the README notes.
While comprehensive, the API closely mirrors Redis commands, making it more verbose for simple tasks compared to higher-level wrappers that abstract away command syntax.