I am needing to take a highly nested json file (i.e. Elasticsearch mapping for an index) and produce a list of items.
Example Elasticsearch Mapping:
{
"mappings": {
"properties": {
"class": {
"properties": {
"name": {
"properties": {
"firstname": {
"type": "text"
},
"lastname": {
"type": "text"
}
}
},
"age": {
"type": "text "
}
}
}
}
}
}
Example Desired Result:
["mappings.properties.class.properties.name.properties.firstname",
"mappings.properties.class.properties.name.properties.lastname",
"mappings.properties.class.properties.age"]
I pandas.json_normalize() doesn't quite do what I want. Neither does glom()