JSON formatter for TextWrangler
priore Jan 16th, 2014 131 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # put script in ~/Library/Application Support/TextWrangler/Text Filters/Format JSON.py
- import fileinput
- import json
- if __name__ == "__main__":
- text = ''
- for line in fileinput.input():
- text = text + ' ' + line.strip()
- jsonObj = json.loads(text)
- print json.dumps(jsonObj, sort_keys=True, indent=2)
RAW Paste Data