Traversing and Querying Dicts the easy way
Project description
Traversing and Querying Dicts the easy way
Free software: BSD license
Install
pip install t_dict
Why?
Dealing with deep nested dicts can be a total pain. TDict aims to make less boring working with it, using jsonpointer sintax for that.
It stand on the shoulders of jsonpointer (https://pypi-hypernode.com/pypi/jsonpointer) in order to provide a datastructure
Json-pointer RFC - https://tools.ietf.org/html/rfc6901
Deep traversal in python dicts using Json-pointer syntax
Usage
from td_dict.td_dict import TDict
td = TDict({'nested': { 'dict': 'here' }})
td.find('/nested/dict')
>> 'here'
td.find('/nested/notfound', 'defaultvalue')
>> 'defaultvalue'
td.setin('/nested/dict', 'new')
td['nested']['dict'] == 'new'
>> True
History
0.1.0 (2014-01-11)
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
t_dict-0.1.0.tar.gz
(5.3 kB
view hashes)