filepath_or_buffer : string or open file