O'Reilly logo

Redis Essentials by Hugo Lopes Tavares, Maxwell Dayvson Da Silva

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Python

There are many Redis client libraries for the Python language, and we are going to present redis-py, the most mature Redis client implementation for Python. The Python version used for all examples is 2.7.

Installing redis-py (it is recommended to install it in a virtualenv):

$ pip install redis

In this section, the Python code has comments that represent the result of the previous expression. It is recommended to run all of the code from this section in the interactive Python interpreter (python or ipython in the command line).

The basic commands in Python

Most Redis commands are accessed in redis-py through a very simple interface. Each executed command returns a value synchronously. Some basic commands are shown in the following code, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required