from yaml import safe_load
from pprint import pprint

# loads database credentials in the globals config module
local_params_file = "maison.yaml"
with open(local_params_file, 'r') as file_handle:
    params_content = safe_load(file_handle)
#    pprint(params_content)

prince_code = dict()
for content in params_content:
    prince_code[content[1]] = content[0]

import json
#pprint(prince_code)
sortie = "house_trigram.json"
with open(sortie, "w") as fp:
    json.dump(prince_code, fp, sort_keys=True, indent=4)

entree = sortie
with open(entree, "r") as fp:
    data = json.load(fp)

pprint(data)

