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