split_path_name_ext

split_path_name_ext(full_path)[source]

Split path of a file to directory path, file name and extensions.

Parameters

full_path (str or pathlib.Path) – Path to a file

Returns

Three parts of the input file path:
  • pathlib.Path - Parent directory path

  • str - File name

  • list(str) - File extensions

Return type

tuple

Examples

>>> from tiatoolbox import utils
>>> dir_path, file_name, extensions =
...     utils.misc.split_path_name_ext(full_path)