Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Assign NameStore Dict Str Str NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Dict If CompareIs NameLoad NameLoad body Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareGt Call NameLoad NameLoad Num CompareEq Call NameLoad NameLoad Num body Assign NameStore ListLoad orelse If BoolOpAnd BoolOpAnd CompareGt Call NameLoad NameLoad Num CompareGt Call NameLoad NameLoad Num CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad UnaryOpNot SubscriptLoad NameLoad Index Str body Raise Call NameLoad orelse Assign NameStore Dict For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad orelse Assign NameStore AttributeLoad NameLoad attr If Call NameLoad NameLoad NameLoad body Assign NameStore NameLoad orelse If Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If Call AttributeLoad NameLoad attr Str NameLoad body Return Call NameLoad NameLoad orelse Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults Str body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A 
Outputs the tree as python dict.  It is available under the alias ``'dict'`` 
and ``'dictionary'``.

Options
-------

================= ============================================================== ===========
Name              Description                                                    Default
================= ============================================================== ===========
pretty_string     When True, outputs the ``dict`` as a string with pretty        ``False``
                  formatting.
allow_node_loss   Determines if a duplicate node name will result in a node      ``False`` 
                  loss due to duplicate keys in the dict.
================= ============================================================== ===========

Example Output
--------------
.. code-block:: python

    tree('dict', pretty_string=True)

.. code-block:: python 

    {'author': {'genre': 'Fantasy/Comedy',
                'name': 'Terry Pratchett',
                'novels': ['Small Gods', 'The Fifth Elephant', 'Guards! Guards!']}}

Duplicate Node Names
--------------------
While xml handles duplicate nodes just fine, python dicts and json for that matter
do not allow duplicates.  To handle this the DictRenderer will attempt to
group nodes with the same name into a sub dictionary. This is why in the above 
example there is only one key for "novels".

 pprint pformat datatree.render.base InternalRenderer datatree.tree Tree DictRenderer N/A InternalRenderer N/A N/A default_options N/A pretty_string allow_node_loss False False _children_distinct_names N/A N/A self children N/A N/A N/A N/A set N/A N/A c __node_name__ N/A c children N/A render_node N/A N/A self node parent options N/A None None N/A N/A N/A parent None N/A N/A parent N/A N/A N/A options None N/A N/A options N/A N/A user_options N/A N/A self get_options options N/A children N/A N/A self data_only node N/A children N/A N/A children_names N/A N/A self _children_distinct_names children N/A N/A N/A N/A len children 1 N/A N/A len children_names 1 N/A N/A value N/A N/A N/A N/A N/A N/A N/A len children 1 N/A N/A len children_names 1 N/A N/A len children_names N/A len children N/A N/A user_options N/A allow_node_loss N/A N/A N/A NodeLossError N/A N/A value N/A N/A child children N/A N/A N/A N/A self render_node child value options options N/A N/A value N/A node __value__ N/A N/A isinstance node Tree N/A N/A parent value N/A N/A N/A isinstance parent dict N/A N/A N/A parent N/A N/A node __node_name__ value N/A N/A N/A N/A parent append value N/A parent N/A render_final N/A N/A self rendered options N/A None N/A N/A options N/A N/A self get_options options N/A N/A N/A options get pretty_string False N/A N/A N/A pformat rendered N/A N/A rendered N/A N/A NodeLossError N/A Exception N/A __init__ N/A N/A self msg N/A One or more nodes were lost due to duplicate keys. N/A N/A N/A N/A N/A super NodeLossError self __init__ msg N/A N/A