data_merge
Tools for merging data.
| FUNCTION | DESCRIPTION |
|---|---|
comprehensive_merge |
Merges data comprehensively. |
deep_merge |
Merges dicts deeply. |
merge_iterables |
Merge and de-duplicate a bunch of lists into a single list. |
Functions¶
comprehensive_merge
¶
comprehensive_merge(*args: Any) -> Any
Merges data comprehensively.
All arguments must be of the same type.
- Scalars are overwritten by the new values
- lists are merged and de-duplicated
- dicts are recursively merged
| RETURNS | DESCRIPTION |
|---|---|
Any
|
The merged data |
deep_merge
¶
deep_merge(*dicts: dict) -> dict
Merges dicts deeply.
Pass the dictionaries to merge as parameters to the function.
| RETURNS | DESCRIPTION |
|---|---|
dict
|
The merged dict
TYPE:
|
merge_iterables
¶
merge_iterables(iter1: Iterable, iter2: Iterable) -> set
Merge and de-duplicate a bunch of lists into a single list.
Order is not guaranteed.
| PARAMETER | DESCRIPTION |
|---|---|
iter1
|
An Iterable
TYPE:
|
iter2
|
An Iterable
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
set
|
The merged, de-duplicated sequence as a set |