import yaml import json with open("terms.json") as f: terms = json.load(f) print (yaml.dump(terms))