Created
July 31, 2013 20:34
-
-
Save rtoal/6125893 to your computer and use it in GitHub Desktop.
Guess the properties of a JSON file, read from stdin. Not perfect.
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
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