A Python package for recursively updating nested dictionaries with the content of another dictionary.
You can install deep-dict-update
via pip:
pip install deep-dict-update
from deep_dict_update import deep_dict_update
orig_dict = {
'data': [
{'id': 1, 'name': 'Alice'},
{'id': 2, 'name': 'Bob'}
]
}
new_dict = {
'data': [
{'id': 3, 'name': 'Charlie'},
{'id': 4, 'name': 'David'}
]
}
updated_dict = deep_dict_update(orig_dict, new_dict)
print(updated_dict)
{
'data': [
{'id': 3, 'name': 'Charlie'},
{'id': 4, 'name': 'David'}
]
}
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.