import pathlib


def abst_path(path):
    """Returns a PurePath for a string representation, after checking a
    path string is from the root."""
    p = pathlib.PurePath(path)
    assert p.is_absolute()
    return p