import json


def parse_file(path):
    """Return a document parsed from a file.

    :param pathlib.Path path: The file.
    :rtype: dict
    """
    if path.suffix == ".json":
        with path.open() as fp:
            return json.load(fp)
    return {}