Skip to content

ApiDoc API#

Bases: AnyWidget

Renders API documentation for a Python class or function in a notebook.

Examples:

from wigglystuff import ApiDoc

ApiDoc(MyClass)

Create an ApiDoc widget.

Parameters:

Name Type Description Default
obj

A Python class or function to document.

None
width

Maximum pixel width for the widget.

700
show_private

Whether to include _-prefixed methods.

False
Source code in wigglystuff/api_doc.py
def __init__(self, obj=None, *, width=700, show_private=False):
    """Create an ApiDoc widget.

    Args:
        obj: A Python class or function to document.
        width: Maximum pixel width for the widget.
        show_private: Whether to include _-prefixed methods.
    """
    self._obj = obj
    super().__init__(width=width, show_private=show_private)
    if obj is not None:
        self.doc = _extract_doc(obj, show_private)

Synced traitlets#

Traitlet Type Notes
doc dict Introspected documentation payload (auto-generated from the target object).
width int Container width in pixels.
show_private bool Whether to include private (underscore-prefixed) methods.