Skip to content

Instantly share code, notes, and snippets.

@dirkgr
Created February 4, 2015 00:02
Show Gist options
  • Save dirkgr/2e7753f842b98ec49ca5 to your computer and use it in GitHub Desktop.
Save dirkgr/2e7753f842b98ec49ca5 to your computer and use it in GitHub Desktop.
Canonicalizes input JSON files
#!/usr/bin/python
import sys
import json
for f in sys.argv[1:]:
for line in open(f):
j = json.loads(line.strip())
print json.dumps(j, sort_keys=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment