Skip to content

A light-weight package to lazily traverse a deeply nested dictionary.

License

Notifications You must be signed in to change notification settings

AlanAutomated/arboristo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arboristo

Build Status codecov Codacy Badge Code style: black Sourcery

A light-weight package to lazily traverse a deeply nested dictionary.

demo

Installation

pip install arboristo

Basic Usage

>>> from arboristo.arbor import Tree
>>>
>>> t = Tree()
>>>
>>> my_dict = {
...   "a": {
...     "b": "bar",
...     "c": {
...       "d": {
...         "e": {
...           "f": "foo"
...         }
...       }
...     }
...   }
... }
>>>
>>> print(t.get('b').from_dict(my_dict))
[{'path': 'a.b', 'value': 'bar'}]
>>>
>>> print(t.get('a.d.e').from_dict(my_dict))
[{'path': 'a.c.d.e.f', 'value': 'foo'}, {'path': 'a.c.d.e', 'value': {'f': 'foo'}}]

About

A light-weight package to lazily traverse a deeply nested dictionary.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages