from pathlib import Path


def is_path_exists(path: str) -> Path:
    """Check for valid path, if yes, return `Path` else raise `Error` """
    filepath = Path(path)
    if filepath.exists():
        raise FileExistsError(f"{filepath} already exists")
    elif not filepath.parent.exists():
        raise TypeError(f"{filepath} is not a valid path, provide path with file name")
    else:
        return filepath