Examples#
- Connection Examples
- Connecting to a default Redis instance, running locally.
- By default Redis return binary responses, to decode them use decode_responses=True
- Starting with redis-py 8.0, clients use RESP3 on the wire by default while keeping legacy RESP2-compatible Python response shapes. Set
protocol=3explicitly when your application should receive RESP3-specific response shapes; setprotocol=2to force RESP2 on the wire.
- Connecting to a redis instance, specifying a host and port with credentials.
- Connecting to a redis instance with username and password credential provider
- Connecting to a redis instance with standard credential provider
- Connecting to a redis instance first with an initial credential set and then calling the credential provider
- Connecting to a redis instance with AWS Secrets Manager credential provider.
- Connecting to a redis instance with ElastiCache IAM credential provider.
- Connecting to Redis instances by specifying a URL scheme.
- Connecting to Redis instances by specifying RESP3-specific response shapes in a URL.
- Connecting to a Sentinel instance
- Connecting to a default Redis instance, running locally.
- SSL Connection Examples
- Connecting to a Redis instance via SSL
- Connecting to a Redis instance via a URL string
- Connecting to a Redis instance using a ConnectionPool
- Connecting to a Redis instance via SSL, while specifying a minimum TLS version
- Connecting to a Redis instance via SSL, while specifying a self-signed SSL CA certificate
- Connecting to a Redis instance via SSL, and validate the OCSP status of the certificate
- Connect to a Redis instance via SSL, and validate OCSP-stapled certificates
- Asyncio Examples
- Indexing / querying JSON documents
- Basic
setandgetoperations - Vector Similarity
- Pipeline examples
- Timeseries
- Redis Stream Examples
- Stream groups
- OpenTelemetry Python API