code: def json2csv(json_str, show_header=False, separator='\t'):
      
      json_obj = json.loads(json_str)
      cols = [col for col in json_obj.keys()]
      vals = [str(json_obj.get(col)) for col in cols]
      header = None
      if show_header:
          header = separator.join(cols)
      values = separator.join(vals)
  
      return (header, values) if show_header else values
docs: Format a json string to csv like.
      :param json_str: json object string
      :param show_header: can returns csv header line
      :param separator: csv column format separator
      :return: if show_header=False: a string like csv formatting;
               if show_header=True: a tuple (header, csv string)