Dotty dict-like object allow to access deeply nested keys using dot notation.
Project description
dotty_dict
Dotty dictionary with support_for[‘dot.notation.keys’].
Dotty dict-like object allow to access deeply nested keys using dot notation. Create Dotty from dict or other dict-like object to use magic of Dotty.
Ultimate goal is to match all Python dictionary method to work with deeply nested Dotty keys.
Free software: MIT license
Documentation: https://dotty-dict.readthedocs.io.
Features
Access and assign deeply nested dictionary key using dot notation
Return None if key doesn’t exist instead of KeyError exception
Get deeply nested value or default value with .get() method
TODO
Escape dot char for dictionary keys with dot: dotty_dict[‘key.key’]
Delete deeply nested keys: del dotty_dict[‘key.key’]
Check if key exists in deeply nested dictionary: key.key.key in dotty_dict
Check if key does not exist in deeply nested dictionary: deeply.nested not in dotty_dict
Pop nested key: pop( key.key.key[, default] )
Set default bug fix
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.9 (2017-05-06)
Changed
__getitem__ will call __missing__ method if key does not exist
Added
__missing__ method which returns None
full documentation of dotty_dict usage
0.1.8 (2017-05-03)
Changed
Travis YAML configuration compatible with TOX
0.1.0 (2017-05-03)
Added
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dotty_dict-0.1.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 877bd27728761d8913dddb6cba20122b9025f284bc0d7b45070827ae85924adb |
|
MD5 | 565ee10acc59172190b5afcab9725577 |
|
BLAKE2b-256 | 2701c5e14a775ca0c9a6f7818c313aa02b4c5a146e6c6f85842ce627dc920f7a |