Manipulation of directories and/or file paths.

Directory navigation

cd(*subdir[, mkdir, cwd, back_check])

Get the full pathname of a directory (or file).

go_from_altered_cwd(dir_name, **kwargs)

Get the full pathname of an altered working directory.

cdd(*subdir[, data_dir, mkdir])

Get the full pathname of a directory (or file) under data_dir.

cd_data(*subdir[, data_dir, mkdir])

Get the full pathname of a directory (or file) under data_dir of a package.

Directory validation


Convert path to an uniformat (Linux) file path, which is executable in Windows, Linux and macOS.


An alternative to the function path2linux().


Check whether a directory-like string is a (valid) directory name.

validate_dir([path_to_dir, subdir, msg])

Validate the pathname of a directory.

validate_filename(file_pathname[, suffix_num])

If the filename exist, then create new filename with a suffix such as "(1)", "(2)", and so on.

Directory/file control

get_file_pathnames(path_to_dir[, file_ext, ...])

Get all files in the folder with the specified file type.

check_files_exist(filenames, path_to_dir)

Check if queried files exist in a given directory.

delete_dir(path_to_dir[, ...])

Delete a directory or directories.