Return True if the path is a directory, or a symbolic link pointing to a directory; return False if the path is (or points to) any other kind of file, or if it doesn’t exist.
pathlib.types/PathInfo.is_dir
PathInfo.is_dir