Created
September 16, 2013 13:35
-
-
Save carltongibson/6580762 to your computer and use it in GitHub Desktop.
Pretty JSON for use as a BBEdit Text Filter
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/python | |
import fileinput | |
import json | |
if __name__ == "__main__": | |
jsonStr = '' | |
for a_line in fileinput.input(): | |
jsonStr = jsonStr + ' ' + a_line.strip() | |
jsonObj = json.loads(jsonStr) | |
print json.dumps(jsonObj, sort_keys=True, indent=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment