A Python module who does recursive update work on 2 dicts.
Usage
Installation
pip install dict-recursive-update
Examples
>>> from dict_recursive_update import recursive_update
>>> recursive_update({'a': {'b': 2}}, {'a': {'b': 3, 'd': 4}, 'e': 5})
{'a': {'b': 3, 'd': 4}, 'e': 5}
>>> recursive_update('a', 'b')
Traceback (most recent call last):
...
TypeError: Params of recursive_update should be dicts
>>> recursive_update({'a': [1]}, {'a': [2], 'c': {'d': {'c': 3}}})
{'a': [2], 'c': {'d': {'c': 3}}}
>>> recursive_update({'a': {'c': 1, 'd': {}}, 'b': 4}, {'b': 5})
{'a': {'c': 1, 'd': {}}, 'b': 5}
>>> recursive_update({'a': {'c': 1, 'd': {}}, 'b': 4}, {'a': 2})
{'a': 2, 'b': 4}
Why?
This is originally designed for merge multiple configurations in different running environment such as production or stage.
As a node.js developer, package config and lodash are very handy for me. This package is the base of a python-version config package.
In a normal project, there is usually a copy of default configuration, but when we deploy it, some configurations differ from default ones like database address. So a handy configuration-loading package is supposed to load right configurations according to the running environment.
License
Metadata
Release files for dict-recursive-update 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dict_recursive_update-1.0.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for dict_recursive_update-1.0.1-py2.py3-none-any.whl |
Release files / dict_recursive_update-1.0.1-py2.py3-none-any.whl
| Download URL | dict_recursive_update-1.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
24bfdd88ff2bf7bd85870b8c65918002638888a790f7453865bdce6f3b83f8ff
|
|
BLAKE2b-256 checksum How to use checksums |
88402cb6ba8f04590f41bb43f5ddb50217705aa6fcb9499f424160259e7e2b8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for dict-recursive-update 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.