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.5.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file sphinxcontrib-sqlalchemyviz-0.5.tar.gz.

File metadata

  • Download URL: sphinxcontrib-sqlalchemyviz-0.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

File hashes

Hashes for sphinxcontrib-sqlalchemyviz-0.5.tar.gz
Algorithm Hash digest
SHA256 1f70273caa607a7b8ea72d28a7c4410fc325f4310a69c06037cc0187c15ae804
MD5 a7b49d4401c914a4e7af976365165de1
BLAKE2b-256 a5c88d1981adb238fc8de100e3e74552bd2cb448cd75a22350564527b3e70e04

See more details on using hashes here.

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