anyconfig.utils.files
¶
Utility funtions to process file and file paths.
- anyconfig.utils.files.is_io_stream(obj)¶
Test if given object
obj
is an IO stream, file or -like object.- Return type:
bool
- anyconfig.utils.files.get_path_from_stream(strm, *, safe=False)¶
Try to get file path from given file or file-like object ‘strm’.
- Parameters:
strm (
IO
) – A file or file-like object might have its file path info- Return type:
str
- Returns:
file path or None
- Raises:
ValueError