Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand API #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions sqlalchemy_data_model_visualizer.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
from datetime import datetime
from typing import Optional
from enum import Enum
from decimal import Decimal
from sqlalchemy.orm import sessionmaker, declarative_base, relationship
from sqlalchemy import Column, String, DateTime, Integer, Numeric, Boolean, JSON, ForeignKey, LargeBinary, Text, UniqueConstraint, CheckConstraint, text as sql_text
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import declarative_base, relationship
from sqlalchemy import Column, String, DateTime, Integer, Numeric, Boolean, JSON, ForeignKey, LargeBinary, Text, CheckConstraint
from sqlalchemy import inspect
import graphviz
from lxml import etree
import os
import re
Base = declarative_base()

def generate_data_model_diagram(models, output_file='my_data_model_diagram', add_labels=True, view_diagram=True):
def generate_data_model_diagram(models, output_file='my_data_model_diagram', add_labels=True, view_diagram=True, format='svg'):
# Initialize graph with more advanced visual settings
dot = graphviz.Digraph(comment='Interactive Data Models', format='svg',
dot = graphviz.Digraph(comment='Interactive Data Models', format=format,
graph_attr={'bgcolor': '#EEEEEE', 'rankdir': 'TB', 'splines': 'spline'},
node_attr={'shape': 'none', 'fontsize': '12', 'fontname': 'Roboto'},
edge_attr={'fontsize': '10', 'fontname': 'Roboto'})
Expand Down