Executing custom redis commands from redis-py

6.4k views Asked by At

I used Dynamic Redis to add additional functionality to redis. I'm able to use the commands from the redis-cli. Is it possible to use redis-py to use those new commands in a python script ?

1

There are 1 answers

1
har777 On BEST ANSWER

Found the answer. Just extend one of the client classes(StrictRedis or Redis) and use their execute_command method.

redis_client = redis.StrictRedis(host, port, db)
data = redis_client.execute_command('custom redis command')

https://github.com/andymccurdy/redis-py/issues/632