Created
October 29, 2012 13:05
-
-
Save jessearmand/3973426 to your computer and use it in GitHub Desktop.
Streaming JSON parser with ijson
This file contains hidden or 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/local/bin/python | |
from sys import argv | |
import ijson | |
script, filepath = argv | |
f = open(filepath, 'r') | |
parser = ijson.parse(f) | |
for prefix, event, value in parser: | |
print "%r: %r - %r" % (event, prefix, value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment