get_path#

scikitplot.utils._path.get_path(*, filename=None, ext=None, file_path=None, subfolder=None, add_timestamp=False, return_parts=False, overwrite=True, verbose=False, **kwargs)[source]#

Generate a full file path for saving result images, ensuring the target directory exists.

Parameters:
filenamestr, optional

Base name of the image file. Defaults to ‘plot_image’.

extstr, optional, default=None

File extension (e.g., ‘.png’, ‘.jpg’). Defaults to try to find filename if not fallback to ‘.png’.

file_pathstr, optional

Directory path to save the image. Defaults to the current working directory.

subfolderstr, optional

Optional subdirectory inside the main path.

add_timestampbool, optional, default=False

Whether to append a timestamp to the filename. Default is False.

overwritebool, optional, default=True

If False and a file exists, auto-increments the filename to avoid overwriting.

return_partsbool, optional

If True, returns (full_path, file_path, filename) instead of just the full path.

verbosebool, optional

If True, prints the final save path.

Returns:
str or tuple

The full file path, or a tuple (full_path, file_path, filename) if return_parts=True.

Raises:
ValueError

If the provided file extension is not supported.