docster
docster.helpers
docster.helpers.resolve_module_name
Performs path arithmetics to determine a qualified module name
Args:
module_path (Path): path to the module whose qual name to resolve
base_dir (Path): path to the package root
Returns:
str: qualified module name, i.e. "root.foo.bar" for "root/foo/bar"
docster.helpers.resolve_doc_file_path
Return the absolute path to a rendered doc file
Args:
module_name (str): the module name, i.e. "networkx.drawing.layout"
out_dir (Path): the output directory, i.e. Path("/build")
file_extension (str): the desired file extension, i.e. ".md"
Returns:
Path: path to the rendered doc file,
i.e. Path("/build/networkx/drawing/layout.md").resolve()
docster.helpers.find_modules
Recursively find all modules in a directory
docster
docster.main
docster.main.process_package
None
docster.main.remote
Fetch a remote git repo, extract docstrings and render a template
docster.main.local
Extract docstrings from a local package and render a template
docster.visitor
docster.visitor.DocstringVisitor
Traverses the AST und extracts docstring and metadata from modules, classes and callables
docster.visitor.DocstringVisitor.qual_name
docster.visitor.DocstringVisitor.visit_Module
Extract docstring and metadata from an ast.Module node
docster.visitor.DocstringVisitor.visit_ClassDef
Extract docstring and metadata from an ast.ClassDef node
docster.visitor.DocstringVisitor.visit_AsyncFunctionDef
Extract docstring and metadata from an ast.AsyncFunctionDef node
docster.visitor.DocstringVisitor.visit_FunctionDef
Extract docstring and metadata from an ast.FunctionDef node
docster.visitor.parse
Extract structured docstrings from a module
Args:
module (Path): path to a python module, i.e. dash/dash.py
module_name (str): name of the module, i.e. dash.dash
Returns:
Module: a docster.models.Module containing structured docstrings
docster.models
docster.models.Node
Documentation for an AST node
docster.models.FuncDef
Documentation for a function or method definition
docster.models.FuncDef.signature
Get the function or method signature as a string
docster.models.ClassDef
Representation of docstrings for a class
docster.models.ClassDef.methods
Get non-private and non-dunder methods of a class
Returns:
List[FuncDef]: A list of docster.models.FuncDef objects
docster.models.ClassDef.constructor
The __init__ method of the class, if one is explicitely defined
docster.models.Module
Representation of docstrings and metadata contained in a module
docster.models.Module.classes
List of public classes in the module
docster.models.Module.functions
List of public functions in the module
docster.models.Package
Representation of docstrings and metadata contained in a Package
docster.models.Package.modules
List of public modules in the package
docster.models.Package.render
Render a template with the package
docster.models.Package.render_modules
Render a template for each module
docster.models.OutputMode
How and where to render and write documentation
OutputMode.file: render documentation for the entire package in a singe file.
The template receives a Package instance
OutputMode.stdout: same as OutputModel.file, but write to standard output instead
OutputMode.directory: render documentation in one file per module, where the
package structure is preserved
docster.models.OutputMode.apply
Render and write documentation according to the output mode
Args:
package (Package): [description]
output (Path): [description]
template_file (Path): [description]