A deep merge function for 🐍.
Project description
mergedeep
A deep merge function for 🐍.
Installation
$ pip install mergedeep
Usage
Deep merge without mutating the source dicts.
from mergedeep import merge
a = {"keyA": 1}
b = {"keyB": {"sub1": 10}}
c = {"keyB": {"sub2": 20}}
merged = merge({}, a, b, c)
print(merged)
# {"keyA": 1, "keyB": {"sub1": 10, "sub2": 20}}
Deep merge into an existing dict.
from mergedeep import merge
a = {"keyA": 1}
b = {"keyB": {"sub1": 10}}
c = {"keyB": {"sub2": 20}}
merge(a, b, c)
print(a)
# {"keyA": 1, "keyB": {"sub1": 10, "sub2": 20}}
License
MIT © Travis Clarke
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mergedeep-0.0.0.tar.gz
(2.9 kB
view details)
Built Distribution
File details
Details for the file mergedeep-0.0.0.tar.gz
.
File metadata
- Download URL: mergedeep-0.0.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bbfdd5259e436c523a8e58a817cc0772f142e0ae5c2b9e77787862c9b27387a |
|
MD5 | 3baedef63f4b22942cc81d0abc9d7b78 |
|
BLAKE2b-256 | 03575c9d535ad6b0892c4fba2fca913648242a8c2aa0844f42eb0a3de67f0572 |
Provenance
File details
Details for the file mergedeep-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: mergedeep-0.0.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ec14fe105f15f44e7f9bcf19bf3b457cb5b5ffca400646a463d1e4983309c1c |
|
MD5 | 6ab6db7637180e9f4532de4394f23c8c |
|
BLAKE2b-256 | 3678449823d74aef23886e0e5ab5accafcc1dc5a25cbb28f6d723a2428ad9859 |