Skip to content

Instantly share code, notes, and snippets.

@jessearmand
Created October 29, 2012 13:05
Show Gist options
  • Save jessearmand/3973426 to your computer and use it in GitHub Desktop.
Save jessearmand/3973426 to your computer and use it in GitHub Desktop.
Streaming JSON parser with ijson
#!/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