sqlalchemy-schemadisplay
Package for the generation of diagrams based on SQLAlchemy ORM models and or the database itself
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-schemadisplayuv
uv add sqlalchemy-schemadisplaypoetry
poetry add sqlalchemy-schemadisplayInstalling 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
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
eralchemyGenerates Entity Relation (ER) diagrams from…
permissive · top 5,000 on PyPI
sqlacodegenReads an existing database schema and generates…
permissive · top 5,000 on PyPI
paracelsusParacelsus generates Entity Relationship…
permissive · top 15,000 on PyPI
django-diagramGenerates Entity Relationship Diagrams in…
unclear · top 15,000 on PyPI
plantumlGenerates UML diagrams from text markup by…
permissive · top 15,000 on PyPI
sphinxcontrib-plantumlAdds PlantUML diagram rendering to Sphinx…
permissive · top 15,000 on PyPI
sqlbagsqlbag provides a collection of SQLAlchemy…
unclear · top 15,000 on PyPI
Flask-SQLAlchemyFlask-SQLAlchemy integrates SQLAlchemy database…
permissive · top 1,000 on PyPI
GeoAlchemy2GeoAlchemy2 extends SQLAlchemy to work with…
permissive · top 5,000 on PyPI