Keong Lim | c44bcf6 | 2019-07-19 18:43:10 +1000 | [diff] [blame] | 1 | #!/usr/bin/env python |
2 | # convert yaml to json | ||||
3 | # pip3 install pyyaml | ||||
4 | # http://pyyaml.org/wiki/PyYAMLDocumentation | ||||
5 | # py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml | ||||
6 | # gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73 | ||||
7 | |||||
8 | import yaml, json, sys | ||||
9 | sys.stdout.write(json.dumps(yaml.load(sys.stdin), sort_keys=True, indent=2)) | ||||
10 |