Skip to content

Instantly share code, notes, and snippets.

@jwheat
Created September 26, 2019 15:19
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwheat/9a2611b738127f45d32254117fe3b959 to your computer and use it in GitHub Desktop.
Save jwheat/9a2611b738127f45d32254117fe3b959 to your computer and use it in GitHub Desktop.
Rasa domain Assembler
import os
import glob
import hiyapyco
path = 'data/domain'
yaml_list = []
for filename in glob.glob(os.path.join(path, '*.yml')):
with open(filename) as fp:
yaml_file = fp.read()
yaml_list.append(yaml_file)
merged_yaml = hiyapyco.load(yaml_list, method=hiyapyco.METHOD_MERGE)
print(hiyapyco.dump(merged_yaml))
domain_yml_file = open("domain.yml","w+")
domain_yml_file.writelines(hiyapyco.dump(merged_yaml))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment