obspy.core.util.base.open_bytes_stream

open_bytes_stream(file_or_stream)[source]

Context manager to read bytes data stream from the argument, e.g.: with open_bytes_stream(file_or_stream)

Parameters:

file_or_stream (str, Path or file-like object) – The input object to open. If this parameter is already a file-like object, it will not be closed on exit but the stream position will be reset so that the object can be reused

Returns:

a context manager to read bytes data