Redis Command Chipset

This module provides a flexible wrapper for executing Redis commands using redis-py. It defines a dynamic chip that can execute any Redis method asynchronously, with configurable client settings and error handling.

Features:

  • Configurable Redis client settings (host, port, database, etc.).
  • Dynamic method execution based on provided method name and parameters.
  • Supports asynchronous Redis operations.
  • Handles connection errors and invalid method names gracefully.

View source code here: GitHub

redis.redis_execute

Executes a Redis command dynamically using redis-py’s async client.

This chip allows you to execute any Redis command by specifying the method name and its parameters. It validates the method exists on the Redis client before execution and handles errors appropriately.

Refer to redis-py documentation for available commands: redis-py Reference

Request Parameters

FieldTypeDescription
client_settingsConfiguration for the Redis async client.
methodThe Redis method to execute (e.g., 'set', 'get', 'hset').
argstyping.List[typing.Any]Positional arguments for the method.
kwargstyping.Dict[str, typing.Any]Keyword arguments for the method.

Response

FieldTypeDescription
statustyping.Literal['OK', 'CONNECTION_ERROR', 'TIMEOUT', 'METHOD_NOT_FOUND', 'REDIS_ERROR', 'ERROR']Status of the request.
resulttyping.Optional[typing.Any]The result of the Redis command (if successful).
error_messagetyping.Optional[str]Error message if the command failed.

© 2025 South Patron LLC. All rights reserved.

AI everywhere.