from pathlib import Path


def create_unique_name(filename: str, path: Path) -> Path:
    """Creates a unique filename for specified path.
    Args:
        filename: the name of file to create
        path: the path where the file is stored
    Returns:
        An absolute path with directory.
    """
    filename = filename.strip() + ".docx"
    filepath = path / filename
    if filepath.exists():
        # Count available files with same name
        counter = len(list(path.glob(f"{filepath.stem}*docx"))) + 1
        filepath = path / f"{filepath.stem}_{counter}.docx"
    return filepath