python - Ijson parse from list -
i have list in each item contains json data, trying parse data using ijson
since data load huge.
this trying achieve:
article_data=#variable contains list parser = ijson.parse(article_data) id in ijson.items(parser, 'item'): if(id['article_type'] != "monthly briefing" , id['article_type']!="conference"): data_article_id.append(id['article_id']) data_article_short_desc.append(id['short_desc']) data_article_long_desc.append(id['long_desc'])
this error get:
attributeerror: 'generator' object has no attribute 'read'
i thought of converting list
string
, try parse in ijson
, fails , gives me same error.
any suggestions please?
data_article_id=[] data_article_short_desc=[] data_article_long_desc=[] index in article_data: parser = ijson.parse(index) id in ijson.items(parser, 'item'): if(id['article_type'] != "monthly briefing" , id['article_type']!="conference"): data_article_id.append(id['article_id']) data_article_short_desc.append(id['short_desc']) data_article_long_desc.append(id['long_desc'])
since in list, tried 1 .. giving me same error.
'generator' object has no attribute 'read'
Comments
Post a Comment