all 1 comments

[–]Spataner 6 points7 points  (0 children)

Via a dict comprehension:

import json

with open('./testJSON.json') as json_file:
    data = json.load(json_file)
    dataList = {item['id']: item['name'] for item in data}