from pathlib import Path


def valid_path(path):
    """Validate the user-supplied path is a existing directory."""
    if Path(path).is_dir():
        return path
    else:
        raise NotADirectoryError(f'Could not find the directory: {path}')