Skip to main content

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

deep_dict_update-0.1.5.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

deep_dict_update-0.1.5-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file deep_dict_update-0.1.5.tar.gz.

File metadata

  • Download URL: deep_dict_update-0.1.5.tar.gz
  • Upload date:
  • Size: 2.5 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

Hashes for deep_dict_update-0.1.5.tar.gz
Algorithm Hash digest
SHA256 4c20d2fa21e869f3e3952dc976293f89214cf1b49c8715263b2968ad1443dae0
MD5 cb087f6532a083f94ba4dc527bf81706
BLAKE2b-256 c611727df47393b37b7b2e90717da579d530068c0ea2c8f22afec0194644ab3c

See more details on using hashes here.

File details

Details for the file deep_dict_update-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: deep_dict_update-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.3 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

Hashes for deep_dict_update-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a042b0bde925bdabff29b175301b960e80959a9fb4609b777c1f39bd11369260
MD5 2eefd3eaf23d1b4760f71bf8a12a86c4
BLAKE2b-256 192fb4c456efbcf787cacaed05d960256ae5ca7614daff9d62349a9f3aacabf1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page