get_file_obj#
- get_file_obj(uri: str, with_progress: bool = True) ContextManager [source]#
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.
Usage:
with get_file_obj(uri) as f: ...
Adapted from https://stackoverflow.com/a/63831344/5908685.
- Parameters
- Return type