.. py:module:: putil.tree
String where hierarchy levels are denoted by node separator characters
('.'
by default). Node names cannot contain spaces, empty hierarchy
levels, start or end with a node separator character.
For this example tree:
The node names are 'root'
, 'root.branch1'
, 'root.branch1.leaf1'
,
'root.branch1.leaf2'
and 'root.branch2'
Dictionary or list of dictionaries; each dictionary must contain exactly two keys:
- name (NodeName) Node name. See NodeName pseudo-type specification
- data (any) node data
The node data should be an empty list to create a node without data, for
example: {'name':'a.b.c', 'data':[]}
.. autoclass:: ptrie.Trie :members: add_nodes, collapse_subtree, copy_subtree, delete_prefix, delete_subtree, flatten_subtree, get_children, get_data, get_leafs, get_node, get_node_children, get_node_parent, get_subtree, is_root, in_tree, is_leaf, make_root, print_node, rename_node, search_tree, nodes, node_separator, root_node, root_name, __nonzero__, __str__ :show-inheritance: