Skip to main content

Build UML diagrams in the documentation.

Project description

sphinx-uml

PyPI Build Documentation ReadTheDocs

Overview

sphinx-uml is a python package that provides:

  • A Sphinx extension, called using .. uml, which generates UML diagrams from python modules, just like sphinx-pyreverse.
  • The pyreverse2 command, that extends pyreverse provided by pylint.

Compared to sphinx-pyreverse, sphinx-uml outputs enriched dot or SVG UML diagrams.

  • responsive to light/black Sphinx themes (as pydata);
  • if the HTML address is known, the class/attribute/method names can be clicked to browse the corresponding documentation page.

Features

.. uml directive

UML diagrams can be obtained by using the .. uml directive.

Example:

.. uml:: example.module.b1
    :caption: UML diagram of ``example.module.b1``
    :classes:
    :packages:

This toy example shows how to use the .. uml directive in a Sphinx documentation using sphinx.ext.autodoc and sphinx.ext.autosummary.

pyreverse2

The pyreverse2 behaves like the original pyreverse command with two main differences:

  • --ouput: svg and dot are the only supported output formats;
  • --sphinx-html-dir can be used to indicate where is the HTML root directory.

Example: In the example below, we assume that:

  • the example package has been installed
  • the documentation has been built in $HOME/git/sphinx-pyreverse/example/docs/_build/html/
# Generate the UML diagram for each value of x
for x in example example.module example.module.submodule example.module.submodule.c1
do
   pyreverse2 \
      --sphinx-html-dir $HOME/git/sphinx-uml/example/docs/_build/html/ \
      --output svg \
      --project $x \
      $x
   # The previous command outputs {classes,packages}_$o.svg
done

Documentation

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

sphinx_uml-0.4.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_uml-0.4.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_uml-0.4.0.tar.gz.

File metadata

  • Download URL: sphinx_uml-0.4.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sphinx_uml-0.4.0.tar.gz
Algorithm Hash digest
SHA256 bea0371cc315193a13a3018656eee0c365272e5bda59d7503ae6cbc2bb953bdd
MD5 8761c5692f780d3e3df907dea26a98ac
BLAKE2b-256 8ff0641ab5811a6fcdc677b8dcb70a82b45c40240b6d4572b237130c094be0a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_uml-0.4.0.tar.gz:

Publisher: publish_on_pypi.yml on ibgp2/sphinx-uml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_uml-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: sphinx_uml-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sphinx_uml-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 372bfbc189a5b58a7e10de5575242232891e7544e265300374312422f47ed409
MD5 d48b8265c91cadd34227a6d021cbc969
BLAKE2b-256 8548bdf04587173285b4a23e789e067016871656ae23b64a108eebd001a7a18d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_uml-0.4.0-py3-none-any.whl:

Publisher: publish_on_pypi.yml on ibgp2/sphinx-uml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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