from json import loads from pathlib import Path from typing import Any, Union def json_read(filepath: Union[str, Path]) -> Any: with open(str(filepath), "r", encoding="utf-8") as file: output = loads(file.read()) return output