Convert JSON file to XML file

preview_player
Показать описание
1. Learn how to read JSON file.
2. Learn How to write XML file.

JSON and XML files are frequently used in our day to day life and mostly we are facing problem to read and write those files.
Рекомендации по теме
Комментарии
Автор

Any tricks for doing this more automatic, because if they are more than 10 keys is never finished?
Thank you!

higiniofuentes
Автор

Hi I am little new to python and exploring options to convert below type JSON to XML
{
"type": "NaturalPerson",
"sourcePartyId": "001058",
"alternatePartyId": "0000808",
"partyName": "CLI 001058",
"segmentationCode": "A1",
"clientAUM": "161608, 38",
"rmPid": "G319292",
"deceasedDate": "",
"hasMifidProfile": {
"mifidClassification": "3",
"bestExecutionFlag": true
},
"hasActivity": {
"lastMeetingDate": "2017-12-04",
"jointVisitFlag": false,
"counterpartyRiskDiscussed": true,
"portfolioDeviation": false,
"lineManagerNotes": "",
"rmNotes": "ANALIZZATA POSIZIONE. SI DECIDE DI CONTINUARE COSI.",
"travelReport": false

}

but i get error for hasMifidProfile where i am not able to get its elements
TypeError: string indices must be integer

any help would be highly appreciated .

MrAaditya