Created
February 4, 2015 00:02
-
-
Save dirkgr/2e7753f842b98ec49ca5 to your computer and use it in GitHub Desktop.
Canonicalizes input JSON files
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 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