package documentation

Extensions sytem.

Mixin classes ca be applied to objects: "Module", "Class", "Function", "Variable", "Indirection", "Docstring", "Decoration", "Argument", "Location", BUT NOT "TreeRoot".

You create an extension like this:

from pydocspec.ext import VariableMixin, ClassMixin, ApiObjectVisitorExt, AstVisitorExt, ExtRegistrar

# define extension logic
class MyDataMixin(VariableMixin):
    ...
class MyClassMixin(ClassMixin):
    ...
class MyAstVisitor(AstVisitorExt):
    ...
class MyObjectVisitor(ApiObjectVisitorExt):
    ...

# configure your extension components in the extension system, with this special function
# that will be called for each extensions.
def setup_extension(r:ExtRegistrar) -> None:
    r.register_mixins(MyDataMixin, MyClassMixin)
    r.register_astbuild_visitors(MyAstVisitor)
    r.register_postbuild_visitors(MyObjectVisitor)

specfactory.Factory. Because of that, the documentation of the classes listed in this module are incomplete, properties and methods provided by mixin classes can be review in their respective documentation, under the package pydocspec.ext.

Notes
Tree root instance is created before extensions are loaded.
Mixin classes are going to be added to the list of bases when creating the new objects with the
Package default No package docstring; 1/2 module documented
Package opt Optional extensions packaged.

From __init__.py:

Class ApiObjectMixin Undocumented
Class ApiObjectVisitorExt Undocumented
Class AstroidInferenceTip Encapsulate an astroid inference tip to be registered with the ExtRegistrar.
Class AstroidTransform Encapsulate an astroid transform to be registered with the ExtRegistrar.
Class AstVisitorExt Undocumented
Class ClassMixin Undocumented
Class DecorationMixin Undocumented
Class DocstringMixin Undocumented
Class ExtRegistrar The extension registrar interface class.
Class FunctionMixin Undocumented
Class HasMembersMixin Undocumented
Class IndirectionMixin Undocumented
Class InheritableMixin Undocumented
Class LocationMixin Undocumented
Class ModuleMixin Undocumented
Class VariableMixin Undocumented
Function get_default_extensions Get the full names of all the default extension modules included in L{pydocspec}.
Function get_optional_extensions Get the full names of all the default extension modules included in L{pydocspec}.
Function load_extension_module Undocumented
Class _AstroidTransform Base class to customize astroid inference system with a bridge to pydocspec tree.
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.
Function _get_setup_extension_func_from_module Will look for the special function setup_extension in the provided module.
Function _get_submodules Undocumented
Variable _mixin_to_class_name Undocumented
def load_extension_module(builder, mod): (source)

Undocumented

Parameters
builder:astbuilder.BuilderUndocumented
mod:strUndocumented
def get_default_extensions(): (source)

Get the full names of all the default extension modules included in L{pydocspec}.

Returns
Iterator[str]Undocumented
def get_optional_extensions(): (source)

Get the full names of all the default extension modules included in L{pydocspec}.

Returns
Iterator[str]Undocumented
_mixin_to_class_name: Dict[Any, str] = (source)

Undocumented

def _get_mixins(*mixins): (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 pydocspec.ext module.

Parameters
*mixins:Type[Any]Undocumented
Returns
Dict[str, Type[Any]]Undocumented
Raises
TypeErrorIf a mixin does not extends any of the provided base mixin classes.
def _get_submodules(pkg): (source)

Undocumented

Parameters
pkg:strUndocumented
Returns
Iterator[str]Undocumented
def _get_setup_extension_func_from_module(module): (source)

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

Raises ValueError if module do not provide a valid setup_extension() function. Raise ModuleNotFoundError if module is not found.

Returns a tuple(str, callable): extension module name, setup_extension() function.

Parameters
module:strUndocumented
Returns
Callable[[ExtRegistrar], None]Undocumented