import json

data = {


# Map the id and name values from the data
mapped_data = []
for item in data['data']['meta_folders_type_2']:
    mapped_data.append({"folder_name": item["folder_name"]})
    for video in item['videos']:
        mapped_data.append({"assigned_lesson_id": video["assigned_lesson_id"],
                                "id": video["id"],
                                "name": video['name'],
                                "video_id": video["video_id"],
                                "s3_url": video["s3_url"],
                                "uuid": video["uuid"]})

# Print the mapped data
print(json.dumps(mapped_data, indent=2))
with open('IQ-COURSE-MAP2.txt','a+', encoding='utf-8') as outputFile:
      outputFile.write(json.dumps(mapped_data, indent=2))
 Wrap the entire output in JSON format.
user