def load_pyl(filepath):
    """Return python literal from file in filepath."""

    with open(str(filepath), mode="r", encoding="utf-8") as f:

        try:
            return literal_eval(f.read())

        except Exception as err:

            message = f"Error while trying to load {filepath}."

            raise Exception(message) from err
Return python literal from file in filepath.
nodezator/ourstdlibs/pyl.py