Created
May 8, 2016 18:13
-
-
Save sushihangover/8e590f3fdcf674567b208071486ff014 to your computer and use it in GitHub Desktop.
TextWranger Format Filter for Json (~/Library/Application Support/TextWrangler/Text Filters)
This file contains 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 aline in fileinput.input(): | |
jsonStr = jsonStr + ' ' + aline.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