import json


def get_dict_from_json(fp):
    """Get a dict from json"""
    try:
        return dict(json.load(fp))
    except Exception:
        raise ValueError("Could not get a dict from %s" % fp.filename)