import yaml


def json_extractor(json_file, json_key):
    """
    Extracts a field from a json file.
    Helps with writing SporeStack files, especially
    extracting scripts.
    """
    with open(json_file) as json:
        data = yaml.safe_load(json)
        return data[json_key]