Skip to content

Instantly share code, notes, and snippets.

@tangingw
Forked from noahcoad/json2yaml.py
Created March 28, 2020 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tangingw/dd83ed88cc17e4310a14e1fd54ac617b to your computer and use it in GitHub Desktop.
Save tangingw/dd83ed88cc17e4310a14e1fd54ac617b to your computer and use it in GitHub Desktop.
Python to convert json to yaml
#!/usr/bin/env python3
# convert json to yaml
# http://pyyaml.org/wiki/PyYAMLDocumentation
# python3 json2yaml.py < ~/code/manpow/moneybug/mbuploader/support/offices.json
# gist https://gist.github.com/noahcoad/46909253a5891af3699580b8f17baba8
import yaml, json, sys
sys.stdout.write(yaml.dump(json.load(sys.stdin)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment