Installation

The library is distributed from PyPI and can be installed using pip.

$ pip install zrq

The package has a single dependency to redis-py - the official Python Redis client. However, it is heavily recommanded to install ZRQ into a virtualenv.

Redis Server

Redis can be installed on wide range of plateforms. It comes with good defaults to be runned in standalone mode out of the box. ZRQ needs at least the release v5.0 which enable the new streaming data structure.

Warning

The methods described below are solely for development purposes on localhost. For a production grade setup, you must read the official Redis security guide.

High availablity with Redis Sentinel and scaling to Redis Cluster are not covered here.

Using Docker

Using Docker Engine (brought by Docker Desktop) are the preferred way to run a Redis instance as it handle the multi-platform support. To install Docker, you may follow the official Get Docker Desktop guide.

> Runs a container and bind the default redis port to localhost
$ docker run --name redis -dp 127.0.0.1:6379:6379 redis:latest

> Stops the container instance
$ docker stop redis

> Starts a previously stopped container
$ docker start redis

> Removes a stopped container including his data
$ docker rm redis

GNU/Linux

For Debian-like distributions, there is apt.

$ sudo apt update
$ sudo apt install redis
> Starts Redis at background
$ sudo systemctl start redis

From Redis docs: Install Redis on Linux.

macOS

For macOS, there is brew.

$ brew update
$ brew install redis
> Starts Redis at background
$ redis-server --bind 127.0.0.1

From Redis docs: Install Redis on macOS.

Windows

For Windows, you’ll first need to enable WSL2 and use the GNU/Linux apt method. More details can be found on the Redis documentation: Install Redis on Windows.

From Source

You nerd. Check the guide to build Redis from source.