Official Python Client for Redis Database
High-performance, feature-rich Python interface for Redis in-memory data store with support for clustering, pipelines, and async operations.
Learn more about redis-py
redis-py is the official Python client library for Redis, providing both synchronous and asynchronous interfaces to interact with Redis servers. It supports all Redis commands and features including clustering, pub/sub messaging, Lua scripting, transactions, pipelines, and connection pooling. The library offers robust error handling, automatic reconnection capabilities, and comprehensive support for Redis data structures like strings, hashes, lists, sets, sorted sets, streams, and geospatial indexes. Built with performance in mind, it includes native support for connection multiplexing, response parsing optimization, and both standalone and cluster deployment modes. redis-py serves as the foundation for Python applications requiring fast in-memory caching, session management, real-time analytics, message queuing, and distributed locking mechanisms.
Complete Redis Command Coverage
Implements the full Redis command set with native Python data type mappings, automatically handling serialization and deserialization. Supports all modern Redis features including Redis Streams, JSON, Search, TimeSeries, and Graph modules. Regular updates ensure compatibility with the latest Redis versions and new commands as they're released.
Async and Sync APIs
Provides both synchronous and asynchronous client implementations, enabling developers to choose the best approach for their application architecture. The async client leverages Python's asyncio for non-blocking I/O operations, perfect for high-concurrency applications, while the sync client offers simplicity for traditional blocking workloads.
Production-Ready Clustering Support
Features built-in Redis Cluster support with automatic node discovery, hash slot calculation, and failover handling. Includes connection pooling, retry logic, and intelligent request routing across cluster nodes. Handles cluster topology changes transparently, making it ideal for scaling Redis deployments horizontally in production environments.
import redis
r = redis.Redis(host='localhost', port=6379, decode_responses=True)
r.set('user:1000:name', 'Alice Johnson')
name = r.get('user:1000:name')
r.setex('session:abc123', 3600, 'active')
ttl = r.ttl('session:abc123')Documentation-only patch with no functional changes or breaking updates.
- –Review updated multi-database client documentation if using that feature.
- –No code changes, dependencies, or configuration updates required for this release.
Breaking changes to type hints, locks, and async context managers; adds experimental MultiDBClient for Active-Active setups.
- –Replace threading.Lock with RLock in your code to avoid deadlocks; async RedisCluster no longer supports synchronous context managers.
- –Review type hint changes in core.py, json, search modules, and BlockingConnectionPool timeout (now float) if using strict type checking.
Beta adds experimental MultiDBClient for Active-Active setups; ping command return type hint changed (breaking).
- –Update code expecting ping() return type as the method signature and docstrings changed.
- –Test MultiDBClient for eventual consistency and automatic failover across multiple Redis databases.
Top in Data Engineering
Related Repositories
Discover similar tools and frameworks used by developers
dbt-core
SQL-based transformation framework for analytics data warehouses.
HikariCP
Zero-overhead JDBC connection pooling for production Java applications.
drizzle-orm
Lightweight type-safe SQL query builder for TypeScript.
superset
Flask-based BI platform for SQL database visualization.
supabase
PostgreSQL backend with auto-generated APIs and real-time subscriptions.