redis-examples
Some usage examples in Python to discover its features.
Requirements
Examples
- db.py handles parameters and provides redis client instance as “r”
- 01-string.py - String -
SET
,GET
,SETNX
,INCR
,EXPIRE
uv run 01-string.py
- 02-hash.py - Hashes -
HGET
,HGETALL
,HINCRBY
,HEXPIRE
- 03-list-push.py / 03-list-pop.py - Lists -
RPUSH
,BLPOP
,LLEN
- 04-publisher.py / 04-subscriber.py - Pub/Sub
- 05-producer.py / 05-consumer.py - Streams
- 06-geo.py - Geo
- 07-pydantic.py - pydantic / JSON storage