lookup a key in a deeply nested document of dicts and lists
Project description
A small library for python which enables key lookups on deeply nested documents.
Documents may be built out of dictionaries (dicts) and/or lists.
quick start
install
install from pypi using pip:
pip install nested-lookup
or easy_install:
easy_install nested-lookup
or install from source using:
git clone https://github.com/russellballestrini/nested-lookup.git cd nested-lookup pip install .
tutorial
>>> from nested_lookup import nested_lookup
>>> document = [ { 'nachos' : 15 } , { 'salsa' : [ { 'taco': 42 }, { 'burrito' : { 'taco' : 69 } } ] } ]
>>> print(nested_lookup('taco', document))
[42, 69]
misc
- author:
Russell Ballestrini
- web:
- license:
Public Domain
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
nested-lookup-0.0.1.tar.gz
(1.7 kB
view hashes)
Built Distribution
nested_lookup-0.0.1-py2.7.egg
(2.2 kB
view hashes)