munch

Python library for dot-accessible dictionary objects

pipmacoslinuxwindows
Try with needOr install directly
Source

About

A dot-accessible dictionary (a la JavaScript objects)

Commands

munch

Examples

Create a dot-accessible dictionary from a regular dict$ python3 -c "from munch import munchify; d = munchify({'name': 'John', 'age': 30}); print(d.name)"
Convert nested dictionaries to accessible objects$ python3 -c "from munch import Munch; obj = Munch(user={'name': 'Alice', 'email': 'alice@example.com'}); print(obj.user.email)"
Convert back to regular dictionary$ python3 -c "from munch import Munch, unmunchify; m = Munch(key='value'); d = unmunchify(m); print(type(d))"