Skip to content

edward2a/deep_merge.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Dict Merge

dmerge - Recursively merge two dictionaries

Installation

pip install dmerge

Usage

from dmerge import deep_merge

a = {'a': 33,
     'b': {'x': 'z',
           'y': { 'asdf': 'fdsa'}
          }
    }
b = {'x': 44,
     'm': ['2', 'dd', 'asdf'],
     'b': {'y': {'fdsa': 'asdf'}},
           '33': {'rewq': 'qwer'}
    }

r = deep_merge(a,b)

The result will be:

{'b': {'x': 'z',
       'y': {'asdf': 'fdsa',
             'fdsa': 'asdf'
            }
      },
 'x': 44,
 'm': ['2', 'dd', 'asdf'],
 '33': {'rewq': 'qwer'},
 'a': 33
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages