1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-mergedeep
7 SDESC[v11]= Deep merge function for 🐍 (3.11)
8 SDESC[v12]= Deep merge function for 🐍 (3.12)
9 HOMEPAGE= https://github.com/clarketm/mergedeep
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/2c/19/04f9b178c2d8a15b076c8b5140708fa6ffc5601fb6f1e975537072df5b2a
14 DISTFILE[1]= mergedeep-1.3.4-py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY311 PY312
20 OPTIONS_STANDARD= none
21 VOPTS[v11]= PY311=ON PY312=OFF
22 VOPTS[v12]= PY311=OFF PY312=ON
24 DISTNAME= mergedeep-1.3.4.dist-info
28 [PY311].USES_ON= python:v11,wheel
30 [PY312].USES_ON= python:v12,wheel
32 [FILE:1935:descriptions/desc.single]
40 [Documentation Status]
42 A deep merge function for 🐍.
44 [Check out the mergedeep docs]
49 $ pip install mergedeep
55 merge(destination: MutableMapping, *sources: Mapping, strategy: Strategy =
56 Strategy.REPLACE) -> MutableMapping
59 Deep merge without mutating the source dicts.
62 from mergedeep import merge
65 b = {"keyB": {"sub1": 10}}
66 c = {"keyB": {"sub2": 20}}
68 merged = merge({}, a, b, c)
71 # {"keyA": 1, "keyB": {"sub1": 10, "sub2": 20}}
74 Deep merge into an existing dict.
76 from mergedeep import merge
79 b = {"keyB": {"sub1": 10}}
80 c = {"keyB": {"sub2": 20}}
85 # {"keyA": 1, "keyB": {"sub1": 10, "sub2": 20}}
90 1. Replace (*default*)
95 # When `destination` and `source` keys are the same, replace the
96 `destination` value with one from `source` (default).
98 # Note: with multiple sources, the `last` (i.e. rightmost) source value
99 will be what appears in the merged result.
101 from mergedeep import merge, Strategy
103 dst = {"key": [1, 2]}
104 src = {"key": [3, 4]}
106 merge(dst, src, strategy=Strategy.REPLACE)
107 # same as: merge(dst, src)
115 > `Strategy.ADDITIVE`
118 # When `destination` and `source` values are both the same additive
119 collection type, extend `destination` by adding values from `source`.
120 # Additive collection types include: `list`, `tuple`, `set`, and `Counter`
122 # Note: if the values are not additive collections of the same type, then
123 fallback to a `REPLACE` merge.
125 from mergedeep import merge, Strategy
127 dst = {"key": [1, 2], "count": Counter({"a": 1, "b": 1})}
128 src = {"key": [3, 4], "count": Counter({"a": 1, "c": 1})}
130 merge(dst, src, strategy=Strategy.ADDITIVE)
136 70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307 6354 mergedeep-1.3.4-py3-none-any.whl