Last active
December 27, 2019 22:46
-
-
Save noahcoad/51934724e0896184a2340217b383af73 to your computer and use it in GitHub Desktop.
Python to Convert yaml to json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert yaml to json | |
# pip3 install pyyaml | |
# http://pyyaml.org/wiki/PyYAMLDocumentation | |
# py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml | |
# gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73 | |
import yaml, json, sys | |
sys.stdout.write(json.dumps(yaml.load(sys.stdin), sort_keys=True, indent=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You left out a colon after
mgmt
on the 4th line.