har777
har777

Reputation: 503

Executing custom redis commands from redis-py

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 ?

Upvotes: 4

Views: 7040

Answers (1)

har777
har777

Reputation: 503

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

Upvotes: 20

Related Questions