Skip to content

Instantly share code, notes, and snippets.

@rtoal
Created July 31, 2013 20:34
Show Gist options
  • Save rtoal/6125893 to your computer and use it in GitHub Desktop.
Save rtoal/6125893 to your computer and use it in GitHub Desktop.
Guess the properties of a JSON file, read from stdin. Not perfect.
import re
import sys
pattern = re.compile(r'"[\w]+":')
all = set([])
for line in sys.stdin:
keys = re.findall(pattern, line)
all.update(keys)
print all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment