Docrepr is a library to render Python docstrings as html pages. It is based on
the sphinxify
module developed by Tim Dumol for the Sage Notebook and the
utils.inspector
one developed for Spyder.
Video presentation @ SciPy 2015 by Carlos Cordoba:
The module renders a dictionary as returned by IPython oinspect
module and
exports two functions: sphinxify
which uses Sphinx to render docstrings,
and rich_repr
that generates full HTML page (with all assets) from
IPython.core.oinspect
output and returns a URL to it.
Example:
>>> import docrepr, IPython
>>> myset = set()
>>> oinfo = IPython.core.oinspect.Inspector().info(myset, oname='myset')
>>> docrepr.sphinxify.rich_repr(oinfo)
c:\users\user\appdata\local\temp\docrepr\tmpwvoj3s\rich_repr_output.html
docrepr
can also show a window with rendered documentation of a docstring
if you have PyQt4 or PySide installed:
from docrepr import webview
import numpy
webview(numpy.sin, oname='bar')
oname
is a just a name for the object, because Python loses it when
variable is passed to function.