[Solved] Tuples conversion into JSON with python [closed]
Assuming you want a list of dicts as the output of the json with each dict be the form in your question: The following one liner will put it into the data structure your looking for with each tuple generating it’s own complete structure: [{‘name’:i[0], ‘children’: [{‘name’: i[1], ‘value’: i[2]}]} for i in tuples] But … Read more