builders

class APIBuilder(initial_source_paths: Sequence[str | Path], target_directory: str | Path, document_empty_modules: bool = True, document_private_members: bool = False, document_private_modules: bool = False, member_documenter_classes: Sequence[type[MemberDocumenter]] | None = None, module_documenter_class: type[ModuleDocumenter] | None = None, omit_root: bool = False, root_documenter_class: type[RootDocumenter] | None = None, title: str = 'API', logger_func=None)

Bases: object

A builder of reStructuredText API documentation for Python packages.

>>> import uqbar
>>> import tempfile
>>> with tempfile.TemporaryDirectory() as target_directory:
...     with uqbar.io.DirectoryChange(target_directory):
...         builder = uqbar.apis.APIBuilder(
...             initial_source_paths=uqbar.apis.__path__,
...             target_directory=target_directory,
...         )
...         visited_paths = builder()
... 
wrote index.rst
wrote uqbar/index.rst
wrote uqbar/apis/index.rst
wrote uqbar/apis/builders.rst
wrote uqbar/apis/documenters.rst
wrote uqbar/apis/dummy.rst
wrote uqbar/apis/graphs.rst
wrote uqbar/apis/nodes.rst
wrote uqbar/apis/summarizers.rst
Parameters:
initial_source_paths: Sequence[str | Path]

a list of paths to scan for Python sources

target_directory: str | Path

where to write reStructuredText output

document_private_members: bool = False

whether to document private module members

document_private_modules: bool = False

whether to document private modules

member_documenter_classes: Sequence[type[MemberDocumenter]] | None = None

a list of MemberDocumenter subclasses, defining what classes to use to identify and document module members

module_documenter_class: type[ModuleDocumenter] | None = None

a ModuleDocumenter subclass

root_documenter_class: type[RootDocumenter] | None = None

a RootDocumenter subclass

__call__()

Generate documentation.

build_node_tree(source_paths)

Build a node tree.

collect_module_documenters(root_node)
prune(visited_paths)
write(documenters)
property document_empty_modules
property document_private_members
property document_private_modules
property initial_source_paths
property member_documenter_classes
property module_documenter_class
property omit_root
property root_documenter_class
property target_directory