Skip to content

Python module that makes it easy to extract subdicts from python dicts by just specifying which keys are needed in a dotted-syntax

Notifications You must be signed in to change notification settings

victor-o-silva/python_subdict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python_subdict

Build Status Code Health Coverage Status

The intent of this library is to make it easy to extract subdicts from python dicts by just specifying which keys are needed, in a dotted-syntax.

Example

>>> from subdict import extract_subdict
>>> d = {'a': 1, 'b': 0, 'c': {'ca': '3', 'cb': {'cba': 0, 'cbb': False}}}
>>> extract_subdict(d, ['a', 'c.cb.cbb'])
{'a': 1, 'c': {'cb': {'cbb': False}}}

Documentation Links

IPython-Notebook version

Markdown version

About

Python module that makes it easy to extract subdicts from python dicts by just specifying which keys are needed in a dotted-syntax

Resources

Stars

Watchers

Forks

Packages

No packages published