summaryrefslogtreecommitdiffstats
path: root/yaml2json.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaml2json.py')
-rw-r--r--yaml2json.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/yaml2json.py b/yaml2json.py
new file mode 100644
index 0000000..2aa315e
--- /dev/null
+++ b/yaml2json.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+# 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))
+