Skip to main content

Extract subdicts from python dicts by just specifying which keys are needed, in a dotted-syntax.

Project description

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}}}

Project details


Release history Release notifications | RSS feed

This version

0.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for subdict, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size subdict-0.5.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page