import yaml
config = yaml.safe_load(open("path/to/config.yml"))
# config.json
{
"mysql":{
"host":"localhost",
"user":"root",
"passwd":"my secret password",
"db":"write-math"
},
"other":{
"preprocessing_queue":[
"preprocessing.scale_and_center",
"preprocessing.dot_reduction",
"preprocessing.connect_lines"
],
"use_anonymous":true
}
}
import json
with open('config.json') as json_data_file:
data = json.load(json_data_file)
print(data)