def fix_json(name): data = iotools.load_raw(name) lines = data.split("\n") if lines[-1] == "": del lines[-1] data = "[%s]" % ",".join(lines) iotools.save_raw(data, name) data = iotools.load_json(name) iotools.save_json(data, name)
def save_keywords(): iotools.save_json(generate_keywords_dict(), 'data/keywords.json') iotools.save_json(generate_all_dataset_keywords_dict(), 'data/dataset-keywords.json')