alendit / sphinx-pyreverse

Simple sphinx wrapper around pyreverse (from pylint suit) to generate UML diagramms from modules.
GNU General Public License v3.0
50 stars 20 forks source link

Sphinx-pyreverse

.. image:: https://circleci.com/gh/alendit/sphinx-pyreverse.svg?style=svg :target: https://circleci.com/gh/alendit/sphinx-pyreverse

.. image:: https://badge.fury.io/py/sphinx-pyreverse.svg :target: https://badge.fury.io/py/sphinx-pyreverse

A simple sphinx extension to generate a UML diagram from python modules.

Install

Install with:::

pip install sphinx-pyreverse

Usage

Add "sphinx_pyreverse" to the extensions list in your conf.py (make sure it is in the PYTHONPATH).

Call the directive with path to python module as content. The :classes: and :packages: flags specify which UML diagrams to show.::

.. uml:: {{modulename}}
    :classes:
    :packages:

Requires pyreverse from pylint.

Options ^^^^^^^

To configure usage, in your conf.py

Changing the directive ^^^^^^^^^^^^^^^^^^^^^^

To override the directive, which defaults to 'uml' set the SPHINX_PYREVERSE_DIRECTIVE environment variable to whatever you like.

Troubleshooting ^^^^^^^^^^^^^^^

sphinx-pyreverse uses sphinx-docs' logging api to write information to the log-files.

To use it run your sphinx-build command with -v -v -v -w $(pwd)/sphinx.log .

For more information see:

.. -v switch: https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-v .. -w switch: https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-w