The purpose of walrus is to make working with Redis in Python a little easier by wrapping rich objects in Pythonic containers.
Let’s see how this works by using
walrus in the Python interactive shell. Make sure you have redis installed and running locally.
To begin using walrus, we’ll start by importing it and creating a
Database instance. The
Database object is a thin wrapper over the redis-py
Redis class, so any methods available on
Redis will also be available on the walrus
>>> from walrus import * >>> db = Database(host='localhost', port=6379, db=0)
If you like fun names, you can also use
>>> from walrus import * >>> db = Walrus(host='localhost', port=6379, db=0)