pathlib.Path.is_symlink()

Path.is_symlink() Return True if the path points to a symbolic link, False otherwise. False is also returned if the path doesn’t exist; other errors (such as permission errors) are propagated.

pathlib.Path.is_socket()

Path.is_socket() Return True if the path points to a Unix socket (or a symbolic link pointing to a Unix socket), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.

pathlib.Path.is_file()

Path.is_file() Return True if the path points to a regular file (or a symbolic link pointing to a regular file), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.

pathlib.Path.is_fifo()

Path.is_fifo() Return True if the path points to a FIFO (or a symbolic link pointing to a FIFO), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.

pathlib.Path.is_dir()

Path.is_dir() Return True if the path points to a directory (or a symbolic link pointing to a directory), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.

pathlib.Path.is_char_device()

Path.is_char_device() Return True if the path points to a character device (or a symbolic link pointing to a character device), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.

pathlib.Path.is_block_device()

Path.is_block_device() Return True if the path points to a block device (or a symbolic link pointing to a block device), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.

pathlib.Path.home()

classmethod Path.home() Return a new path object representing the user’s home directory (as returned by os.path.expanduser() with ~ construct): >>> Path.home() PosixPath('/home/antoine') New in version 3.5.

pathlib.Path.group()

Path.group() Return the name of the group owning the file. KeyError is raised if the file’s gid isn’t found in the system database.

pathlib.Path.glob()

Path.glob(pattern) Glob the given pattern in the directory represented by this path, yielding all matching files (of any kind): >>> sorted(Path('.').glob('*.py')) [PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')] >>> sorted(Path('.').glob('*/*.py')) [PosixPath('docs/conf.py')] The “**” pattern means “this directory and all subdirectories, recursively”. In other words, it enables recursive globbing: >>> sorted(Path('.').glob('**/*.py'))