from typing import Union
from pathlib import Path


def to_path(path: Union[str, Path]) -> Path:
    """Convert str to Path."""

    if not isinstance(path, Path):
        path = Path(path)

    return path