I need to parse a string value and load into a python dictionary
Input:
attributes = "LIFETIME=203421,ID=acr44,SCOPE=[open,basic.operation:read,common.operation:write],USER=b611-410e,CLAIMS_"
Expected Output :
attributesDictionary = { "LIFETIME" : "203421",
"ID" : "acr44",
"SCOPE" : "[open,basic.operation:read,common.operation:write]",
"USER" : "b611-410e",
"CLAIMS_" : None
}
attributesDictionary["ID"]
>>> 'acr44'
attributesDictionary["SCOPE"]
>>> '[open,basic.operation:read,common.operation:write]'
I am new to python programming. How can we achieve this ?