Skip to main content

A tool to visualize SQLAlchemy data models with Graphviz.

Project description

SQLAlchemy Data Model Visualizer

Overview

This Python-based utility generates high-quality, readable visualizations of your SQLAlchemy ORM models with almost no effort. With a focus on clarity and detail, it uses Graphviz to render each model as a directed graph, making it easier to understand the relationships between tables in your database schema.

Example Data Model Diagram

Try it Out Easily in Colab:

Open In Colab

Features

  • Automatically maps SQLAlchemy ORM models to a directed graph.
  • Table-like representation of each model with fields, types, and constraints.
  • Export diagrams to SVG format for high-quality viewing and printing using Roboto font.

Installation

To get started, clone the repository and install the required packages.

git clone https://github.com/Dicklesworthstone/sqlalchemy_data_model_visualizer.git
cd sqlalchemy_data_model_visualizer
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install wheel
pip install -r requirements.txt

Requirements

  • Python 3.x
  • SQLAlchemy
  • Graphviz
  • lxml

Usage

Generate Data Model Diagram

First, paste in your SQLAlchemy models. A set of fairly complex data models are provided in the code directly as an example-- just replace these with your own from your application.

Then, simply call the generate_data_model_diagram function. This will generate an SVG file with the name my_data_model_diagram.svg.

API Documentation

generate_data_model_diagram(models, output_file='my_data_model_diagram')

  • models: List of SQLAlchemy models you want to visualize.
  • output_file: Name of the output SVG file.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

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

sqlalchemy_data_model_visualizer-0.1.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file sqlalchemy_data_model_visualizer-0.1.2.tar.gz.

File metadata

File hashes

Hashes for sqlalchemy_data_model_visualizer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 55b7f42132e763221162477af1f4f9c6338689513c1fafd1b57fef0e65a13591
MD5 697035d1eb2ed467f78e02e3ec05fb1a
BLAKE2b-256 55380451b1f683a99af19746cae248dc3fa32fab153395701e273856ddff715e

See more details on using hashes here.

File details

Details for the file sqlalchemy_data_model_visualizer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_data_model_visualizer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abf93a46b19788583ed21a6159a5e98381fc96db259595ce3db693707b101f8e
MD5 7226de8a71f8e8fc3fe995a441c2cfad
BLAKE2b-256 92e80eef6748aa9e0e20b141c7ee709a83e6d3ddc2d31bcedf7a7fdf0c66501b

See more details on using hashes here.

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