Skip to content

Instantly share code, notes, and snippets.

@SegFaultAX
Created April 7, 2014 19:37
Show Gist options
  • Save SegFaultAX/10037348 to your computer and use it in GitHub Desktop.
Save SegFaultAX/10037348 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import yaml
import json
def convert(data):
y = yaml.load(data)
return json.dumps(y,
indent=4,
sort_keys=True,
separators=(',', ': '))
if __name__ == "__main__":
print convert(sys.stdin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment