--- id: sqlalchemy-schemadisplay version: "2.0" license: unclear license_treatment: permissive maintenance: aging --- # sqlalchemy-schemadisplay — Package for the generation of diagrams based on SQLAlchemy ORM models and or the database itself License: permissive · Maintenance: aging · Downloads: 212.1K/mo ## What it is and what it does sqlalchemy-schemadisplay converts SQLAlchemy ORM models and database schemas into visual diagrams. It takes either a bound MetaData object (reflecting from a live database) or a collection of mapped classes and generates a Graphviz graph, which you can then render to PNG, SVG, or other image formats. The package produces two main diagram types: database entity-relationship diagrams showing tables and foreign-key relationships, and UML class diagrams showing ORM model structure. The tool is designed for developers who need to document or visualize their database architecture. It depends on pydot (a Python wrapper around Graphviz) and Pillow for optional image display. The package requires Python >= 3.8 and is compatible with SQLAlchemy 2.x as of version 2.0. Some advanced features like index reflection and automatic table discovery are PostgreSQL-specific. Use it for: - Generate an ER diagram from an existing PostgreSQL database to document its schema in a visual format. - Create a UML class diagram from your SQLAlchemy model definitions to share with team members or include in documentation. - Visualize relationships and constraints in a legacy database before refactoring or migrating. - Automatically produce schema diagrams as part of a documentation build pipeline. - Inspect foreign-key relationships and table structure without manually drawing diagrams. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates entity-relationship and UML diagrams from SQLAlchemy ORM models and database schemas, outputting them as image files via Graphviz. Yes, if you need to visualize SQLAlchemy schemas or databases. Install friction is low, the license is permissive, and there are no known vulnerabilities. The main caveat is aging maintenance (911 days since last release) and a system dependency on Graphviz; also, some features are PostgreSQL-only. For one-off visualization tasks or documentation, it's a straightforward choice. ## Install pip install sqlalchemy-schemadisplay uv add sqlalchemy-schemadisplay poetry add sqlalchemy-schemadisplay ## Installing sqlalchemy-schemadisplay Before you install: Low friction install with four straightforward runtime dependencies (setuptools, sqlalchemy, pydot, Pillow). Maintenance is aging—last release was 911 days ago—but the repository remains active with a recent commit and no archived status. License in practice: Licensed under MIT (permissive), so you can use, modify, and distribute freely with minimal restrictions. Quickstart: pip install sqlalchemy-schemadisplay from sqlalchemy import MetaData from sqlalchemy_schemadisplay import create_schema_graph graph = create_schema_graph(metadata=MetaData('postgresql://user:pwd@host/db')) graph.write_png('schema.png') Requires Graphviz system library installed; Graphviz-cairo recommended for image quality. Some features (loading table lists, reflecting indexes) only work on PostgreSQL. Verify before relying: - Whether Pillow is truly required at runtime or only for optional image-display features. - Current compatibility status with SQLAlchemy 2.x beyond the stated 2.0 release note. - Whether all non-PostgreSQL databases are fully supported or only partially. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 212.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sqlalchemy schema visualization, database diagram generation, orm model to graph, entity relationship diagram, sqlalchemy uml diagram, database schema image, visualize database relationships, database-visualization, documentation-generation, schema-inspection [View on SkillFed](https://skillfed.io/packages/sqlalchemy-schemadisplay) · [View on PyPI](https://pypi.org/project/sqlalchemy-schemadisplay/)