I have the following output in a file and wants to convert it into a dictionary or other structure in python which be meaningful. Note that in side a field { it is possible to have more blocks of fields recursively.
At the first look, it looks like a nested dictionary, I am looking for a dict like this:
{"A":{"B":"value_B","C":"value_C"}, "D":{"E":{"F":"value_F","G":value_G","H":"value_H","I":"value_I"}}}
fields {
name: "ََA"
fields {
name: "B"
string_value: "value_B"
}
fields {
name: "C"
bytes_value: "value_C"
}
}
fields {
name: "D"
fields {
name: "E"
fields {
name: "F"
string_value: "value_F"
}
fields {
name: "G"
uint32_value: "value_G"
}
fields {
name: "H"
uint32_value: "value_H"
}
fields {
name: "I"
fields {
name: "J"
uint32_value: "value_J"
}
}
}
}
Thanks.