I'd like to be able to set a nested dictionary item using a single dot-delimited string path. For example, given the following dictionary:
data_dictionary = {
"user_data": {
"first_name": "Some",
"last_name": "Guy",
"phone": "212-111-1234"
}
}
I'd like to be able to set a specific item using a single string, something like this:
data_dictionary['user_data.phone'] = '818-333-4567'
Anyone know of a library or simple technique for accomplishing something like this?