Skip to main content

A package to create documentation for functions in Databricks notebooks

Project description

Notebook-doc

Notebook-doc is a Python package that can create documentation for functions in Databricks notebooks.

It can generate documentation from the docstrings of functions.

It will generate documentation as HTML documents, which can be displayed inside Databricks notebooks.

Usage

The package can be used as follows to generate documentation:

  1. Install the package (using PyPi - coming soon)
  2. Import the documentation generator function as follows:
    from notebook_doc import render_documentation
    
  3. Make sure that you have executed all cells that contain function definitions.
  4. Execute render_documentation function and provide the globals() dictionary to generate documentation as a HTML script.

Example (in Databricks)

Databricks displayHTML function can be directly used to display the HTML document returned by the render_documentation function.

from notebook_doc import render_documentation

displayHTML(render_documentation(globals(), module_name='Dummy Module'))

Example (in other notebooks)

HTML output from render_documentation function can be written on a local HTML file so that documentation can be displayed as a HTML file.

from notebook_doc import render_documentation

html_output = render_documentation(globals(), module_name='Dummy Module')

with open('dummy_doc.html', 'w') as f:
    f.write(html_output)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notebook-doc-0.1.1.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

notebook_doc-0.1.1-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page