code: def convert_rtf_to_text(filename: str = None,
                          blob: bytes = None,
                          config: TextProcessingConfig = _DEFAULT_CONFIG) -> str:
      
      unrtf = tools['unrtf']
      if unrtf:  # Best
          args = [unrtf, '--text', '--nopict']
          if UNRTF_SUPPORTS_QUIET:
              args.append('--quiet')
          if filename:
              args.append(filename)
              return get_cmd_output(*args)
          else:
              return get_cmd_output_from_stdin(blob, *args)
      elif pyth:  # Very memory-consuming:
          # https://github.com/brendonh/pyth/blob/master/pyth/plugins/rtf15/reader.py  # noqa
          with get_filelikeobject(filename, blob) as fp:
              doc = pyth.plugins.rtf15.reader.Rtf15Reader.read(fp)
          return (
              pyth.plugins.plaintext.writer.PlaintextWriter.write(doc).getvalue()
          )
      else:
          raise AssertionError("No RTF-reading tool available")
docs: Converts RTF to text.