-
-
Save mpontillo/14ec5fee876bb29987542354d0886cb7 to your computer and use it in GitHub Desktop.
Python script to input YAML and output "pretty" JSON.
This file contains hidden or 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
#!/usr/bin/env python3 | |
import sys | |
import json | |
import yaml | |
if __name__ == "__main__": | |
data = sys.stdin.read() | |
obj = yaml.safe_load(data) | |
print(json.dumps(obj, sort_keys=True, indent=4, separators=(',', ': '))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment