package documentation

Pydoctor's extension system.

An extension can be composed by mixin classes, AST builder visitor extensions and post processors.

Module attrs Support for attrs.
Module deprecate Support for twisted.python.deprecate.
Module zopeinterface Support for Zope interfaces.

From __init__.py:

Class AttributeMixin Base class for mixins applied to model.Attribute objects.
Class CanContainImportsDocumentableMixin Base class for mixins applied to model.Class, model.Module and model.Package objects.
Class ClassMixin Base class for mixins applied to model.Class objects.
Class DocumentableMixin Base class for mixins applied to all model.Documentable objects.
Class ExtRegistrar The extension registrar class provides utilites to register an extension's components.
Class FunctionMixin Base class for mixins applied to model.Function objects.
Class InheritableMixin Base class for mixins applied to model.Function and model.Attribute objects.
Class ModuleMixin Base class for mixins applied to model.Module objects.
Class ModuleVisitorExt Base class to extend the astbuilder.ModuleVistor.
Class PackageMixin Base class for mixins applied to model.Package objects.
Class PriorityProcessor Stores Callable and applies them to the system based on priority or insertion order. The default priority is 100, see code source of astbuilder.setup_pydoctor_extension, and others setup_pydoctor_extension...
Function get_extensions Get the full names of all the pydoctor extension modules.
Function load_extension_module Load the pydoctor extension module into the system.
Constant DEFAULT_PRIORITY Undocumented
Type Alias MixinT Undocumented
Function _get_mixins Transform a list of mixins classes to a dict from the concrete class name to the mixins that must be applied to it. This relies on the fact that mixins shoud extend one of the base mixin classes in pydoctor.extensions...
Function _get_setup_extension_func_from_module Will look for the special function setup_pydoctor_extension in the provided module.
Function _get_submodules Undocumented
Function _importlib_resources_contents Return an iterable of entries in package.
Function _importlib_resources_is_resource True if name is a resource inside package.
Variable _mixin_to_class_name Undocumented
def get_extensions() -> Iterator[str]: (source)

Get the full names of all the pydoctor extension modules.

def load_extension_module(system: model.System, mod: str): (source)

Load the pydoctor extension module into the system.

DEFAULT_PRIORITY: int = (source)

Undocumented

Value
100
def _get_mixins(*mixins: type[MixinT]) -> dict[str, list[type[MixinT]]]: (source)

Transform a list of mixins classes to a dict from the concrete class name to the mixins that must be applied to it. This relies on the fact that mixins shoud extend one of the base mixin classes in pydoctor.extensions module.

Raises
AssertionErrorIf a mixin does not extends any of the provided base mixin classes.
def _get_setup_extension_func_from_module(module: str) -> Callable[[ExtRegistrar], None]: (source)

Will look for the special function setup_pydoctor_extension in the provided module.

Returns
Callable[[ExtRegistrar], None]a tuple(str, callable): extension module name, setup_pydoctor_extension() function.
Raises
AssertionErrorif module do not provide a valid setup_pydoctor_extension() function.
ModuleNotFoundErrorif module is not found.
def _get_submodules(pkg: str) -> Iterator[str]: (source)

Undocumented

def _importlib_resources_contents(package: str) -> Iterable[str]: (source)

Return an iterable of entries in package.

Note that not all entries are resources. Specifically, directories are not considered resources.

def _importlib_resources_is_resource(package: str, name: str) -> bool: (source)

True if name is a resource inside package.

Directories are not resources.

_mixin_to_class_name: dict[Any, str] = (source)

Undocumented