tfdocs.doc_generator_visitor.ApiTree

Public API index.

Items must be inserted in order from root to leaves.

Lookup a path-tuple to fetch a node:

node = index[path]

Use the node_from_obj method to lookup the node for a python object:

node = index.node_from_obj(obj)

Remember that maybe_singleton (numbers, strings, tuples) classes can't be looked up this way.

To build a tree, nodes must be inserted in tree order starting from the root.

root The root ApiFileNode of the tree.

Methods

from_path_tree

View source

Create an ApiTree from an PathTree.

Args
path_tree The PathTree to convert.
score_name_fn The name scoring function.

Returns
an ApiIndex, created from path_tree.

insert

View source

Add an object to the index.

iter_nodes

View source

Iterate over the nodes in BFS order.

node_for_object

View source

__contains__

View source

True if the dictionary has the specified key, else False.

__eq__

View source

Return self==value.