Skip to main content

Sphinx SQLAlchemyViz extension

Project description

This file provides a Sphinx extension to include an Entity-Relationship diagram of SQLAlchemy metadata, generated by the SQLAlchemyViz package. This is a highly unpolished extension which does almost no heavy lifting, and not portable across platforms. The SQLALchemyViz package converts the SQLAlchemy metadata object into a dot file. The extension then uses POSIX/Linux tools via python’s subprocess mechanisms to improve the layout of the graph.

To achieve the same effect directly from the shell, the relevant commands would be :

sqlaviz --unique-relations --show-constraints <pkg.module:metadata> -f out.dot
ccomps -x out.dot | dot | gvpack -array3 | neato -Tpng -n2 -o out.png

Installation & Usage

This extension can be installed from pypi :

pip install sphinxcontrib-sqlalchemyviz

In the .rst file where the table should appear, insert the Sphinx directive provided by this module :

.. .. sqlaviz::
    :metadataobject: full.importable.path.of.metadata

For a basic usage example, see:

Python:

https://github.com/chintal/tendril/blob/master/tendril/utils/db.py#L201

Generated:

http://tendril.chintal.in/doc/apidoc/tendril.utils.db/#tendril.utils.db.metadata

License

This Sphinx Extension is made available under the BSD 2-clause License. See the LICENSE file for the full text.

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

sphinxcontrib-sqlalchemyviz-0.3.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

sphinxcontrib_sqlalchemyviz-0.3-py2-none-any.whl (6.8 kB view hashes)

Uploaded Python 2

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