class_docstr: Create a client for talking to json.
  
  :param decoder:
  :type json.JSONDecoder: An instance of json.JSONDecoder
  
  :param encoder:
  :type json.JSONEncoder: An instance of json.JSONEncoder
class_docstr_tok: ["Create","a","client","for","talking","to","json",".",":","param","decoder",":",":","type","json.JSONDecoder",":","An","instance","of","json.JSONDecoder",":","param","encoder",":",":","type","json.JSONEncoder",":","An","instance","of","json.JSONEncoder"]
docstr: Create a client for talking to json.
  
  :param decoder:
  :type json.JSONDecoder: An instance of json.JSONDecoder
  
  :param encoder:
  :type json.JSONEncoder: An instance of json.JSONEncoder
docstr_tok: ["Create","a","client","for","talking","to","json",".",":","param","decoder",":",":","type","json.JSONDecoder",":","An","instance","of","json.JSONDecoder",":","param","encoder",":",":","type","json.JSONEncoder",":","An","instance","of","json.JSONEncoder"]
code: def __init__(
      self,
      client,
      version=None,
      decoder=JSONDecoder(),
      encoder=JSONEncoder(),
  ):
      """
      Create a client for talking to json.
  
      :param decoder:
      :type json.JSONDecoder: An instance of json.JSONDecoder
  
      :param encoder:
      :type json.JSONEncoder: An instance of json.JSONEncoder
      """
      # Set the module commands' callbacks
      self._MODULE_CALLBACKS = {
          "JSON.ARRPOP": self._decode,
          "JSON.DEBUG": self._decode,
          "JSON.GET": self._decode,
          "JSON.MERGE": lambda r: r and nativestr(r) == "OK",
          "JSON.MGET": bulk_of_jsons(self._decode),
          "JSON.MSET": lambda r: r and nativestr(r) == "OK",
          "JSON.RESP": self._decode,
          "JSON.SET": lambda r: r and nativestr(r) == "OK",
          "JSON.TOGGLE": self._decode,
      }
  
      _RESP2_MODULE_CALLBACKS = {
          "JSON.ARRAPPEND": self._decode,
          "JSON.ARRINDEX": self._decode,
          "JSON.ARRINSERT": self._decode,
          "JSON.ARRLEN": self._decode,
          "JSON.ARRTRIM": self._decode,
          "JSON.CLEAR": int,
          "JSON.DEL": int,
          "JSON.FORGET": int,
          "JSON.GET": self._decode,
          "JSON.NUMINCRBY": self._decode,
          "JSON.NUMMULTBY": self._decode,
          "JSON.OBJKEYS": self._decode,
          "JSON.STRAPPEND": self._decode,
          "JSON.OBJLEN": self._decode,
          "JSON.STRLEN": self._decode,
          "JSON.TOGGLE": self._decode,
      }
  
      _RESP3_MODULE_CALLBACKS = {}
  
      self.client = client
      self.execute_command = client.execute_command
      self.MODULE_VERSION = version
  
      if get_protocol_version(self.client) in ["3", 3]:
          self._MODULE_CALLBACKS.update(_RESP3_MODULE_CALLBACKS)
      else:
          self._MODULE_CALLBACKS.update(_RESP2_MODULE_CALLBACKS)
  
      for key, value in self._MODULE_CALLBACKS.items():
          self.client.set_response_callback(key, value)
  
      self.__encoder__ = encoder
      self.__decoder__ = decoder
  
file_path: redis-py/redis/commands/json/__init__.py
imports: from json import JSONDecodeError, JSONDecoder, JSONEncoder
  import redis
  from ..helpers import get_protocol_version, nativestr
  from .commands import JSONCommands
  from .decoders import bulk_of_jsons, decode_list
label_desc: Use image node_id 1 to create a new JSON object from inherited base classes: JSONCommands with example: obj = JSON(client, version, decoder, encoder)