- get_file_obj(uri: str, with_progress: bool = True) ContextManager #
Returns a context manager for a file-like object that supports buffered reads. If with_progress is True, wraps the read() method of the object in a function that updates a tqdm progress bar.
with get_file_obj(uri) as f: ...
Adapted from https://stackoverflow.com/a/63831344/5908685.