skillfed

sqlalchemy-schemadisplay

Package for the generation of diagrams based on SQLAlchemy ORM models and or the database itself

sqlalchemy-schemadisplay v2.0 212.1K downloads/30d#9,465 on PyPI148
Permissive license AGING released

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 on this page — 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

sqlalchemy-schemadisplay on PyPI

pip

pip install sqlalchemy-schemadisplay

uv

uv add sqlalchemy-schemadisplay

poetry

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 the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 4 — setuptools, sqlalchemy, pydot, Pillow
Maintenance aging — 911 days since the last release
Last repo commit
First released
Downloads 212,089/month — #9,465 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sqlalchemy_schemadisplay-2.0-py3-none-any.whl

Keywords: aiida, workflows, lammps

Development Status :: 4 - BetaDevelopment Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: Implementation :: CPythonTopic :: Database :: Front-Ends

Tags

sqlalchemy schema visualizationdatabase diagram generationorm model to graphentity relationship diagramsqlalchemy uml diagramdatabase schema imagevisualize database relationships
database-visualizationdocumentation-generationschema-inspection

More Front-Ends packages