Skip to content

Instantly share code, notes, and snippets.

@carltongibson
Created September 16, 2013 13:35
Show Gist options
  • Save carltongibson/6580762 to your computer and use it in GitHub Desktop.
Save carltongibson/6580762 to your computer and use it in GitHub Desktop.
Pretty JSON for use as a BBEdit Text Filter
#! /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