I'm using ijson.kvitems to iterate over all of the keys in a JSON file that I have.
the JSON file looks like this:
{"filename":{"file_data":
{"name":"samplefile",
"filetype":"Miscellaneous",
"id":123,
"timestamp":"2020-10-08 00:20:00"}}}
based on this answer, a simplified version of my code looks something like so (v is a dictionary too):
import ijson
f = open('file.json')
for k, v in ijson.kvitems(f, ''):
name = v['name']
user_id = v['id']
filetype = v['filetype']
timestamp = v['timestamp']
I am only able to stream/read about 94% of the keys from the original file this way, trying to figure out if there is a way to get to the remaining 6%.
Thanks!!