import json


def from_json(config_file_path):
    """Read data from a json file.

    Check the file exists and create it if not.
    We want to return an empty dict and not fail if the file contains no data.

    :param config_file_path Path: Path representing the file-to-read.
    :returns dict: config data (or an empty dict if there was no data).
    """
    config_file_path.touch(exist_ok=True)
    try:
        with open(str(config_file_path.resolve()), "r") as dfile:
            return json.load(dfile)
    except json.JSONDecodeError:
        # The file contains no parsable json.
        # In this case return an empty dict.
        return dict()