Created
December 15, 2014 11:36
-
-
Save mpitid/18dec4c807fe591c362f to your computer and use it in GitHub Desktop.
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 python | |
import sys, json, yaml | |
def transform(filename=None): | |
stream = sys.stdin if filename is None else open(filename, 'rb') | |
return json.dumps(yaml.load(stream), separators=(',',':')) | |
if __name__ == '__main__': | |
sys.stdout.write(transform(*sys.argv[1:])) | |
sys.stdout.write("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment