Recursively update nested dictionaries with another dictionary
Project description
deep-dict-update
A Python package for recursively updating nested dictionaries with the content of another dictionary.
Installation
You can install deep-dict-update via pip:
pip install deep-dict-update
Usage
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)
Output
{
'data': [
{'id': 3, 'name': 'Charlie'},
{'id': 4, 'name': 'David'}
]
}
Contributing
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deep_dict_update-0.1.6.tar.gz.
File metadata
- Download URL: deep_dict_update-0.1.6.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.2 Linux/6.2.0-1019-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a935cff46d67d090850f7b1380ac2f4826e1a9c4b5e64aa6a10f5ccfe65f1c03
|
|
| MD5 |
9580fd425d5492b0870691172826e121
|
|
| BLAKE2b-256 |
00ae030907255ecb6c63e381dd029c1fa5853eaec2f23874faafd55787583192
|
File details
Details for the file deep_dict_update-0.1.6-py3-none-any.whl.
File metadata
- Download URL: deep_dict_update-0.1.6-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.2 Linux/6.2.0-1019-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fc7f7f623e5882ec533b72f46fdd8b5880e195778a79fe869fc7d7cd3d130cd
|
|
| MD5 |
f73ba425d94f56989b8df54531818724
|
|
| BLAKE2b-256 |
f1f76d21ea2a4c95eb83cf70ec4dbc3fa99ae1c3b4c63678680986f4b80162fd
|