code: def cli(out_fmt, input, output):
      
      _input = StringIO()
      for l in input:
          try:
              _input.write(str(l))
          except TypeError:
              _input.write(bytes(l, 'utf-8'))
      _input = seria.load(_input)
      _out = (_input.dump(out_fmt))
      output.write(_out)
docs: Converts text.