Skip to content

Instantly share code, notes, and snippets.

@Exceen
Forked from sbp/json2yaml.sh
Created Aug 11, 2018
Embed
What would you like to do?
Convert JSON to YAML
#!/bin/sh
export PYTHONPATH=$HOME/usr/opt/pyyaml/lib/python2.6/site-packages
python -c '
import sys, json, yaml
with open(sys.argv[1]) as f:
print yaml.safe_dump(json.load(f), default_flow_style=False)
' $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment