obspy.core.util.base.get_text_stream

get_text_stream(file_or_stream, encoding='utf-8')[source]

Return a file-like object streaming text data (str objects)

Parameters:
  • file_or_stream (str, Path or file-like object) – the input from which to return the stream of text

  • encoding (str) – the encoding used. If the passed argument is already a file-like object of encoded text data, this argument is ignored

Returns:

a file-like object streaming text data