import json


def jsonify(results, indent=True):
    """Export results as JSON.

    :param results: results from  RuleBurner.compute()
    :type results: list of dict
    :param indent: indent the JSON for humans if True.
    :type indent: bool
    :returns json_str: JSON string representation
    :rtype: str
    """
    # Trim-out the RDKit objects under the "product_list" key
    results_no_mol = [{k: v for k, v in d.items() if k != 'product_list'} for d in results]
    return json.dumps(results_no_mol, indent=indent)