from pathlib import Path


def path_type(value) -> Path:
    """argparse type for converting string into a pathlib.Path object"""
    p = Path(value)
    if not p.exists():
        raise ValueError(f"Given Path not found: {value}")
    return p