sqlalchemy-schemadisplay
Package for the generation of diagrams based on SQLAlchemy ORM models and or the database itself
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Graphviz system library installed; Graphviz-cairo recommended for image quality.
- Some features (loading table lists, reflecting indexes) only work on PostgreSQL.
- Low friction install with four straightforward runtime dependencies (setuptools, sqlalchemy, pydot, Pillow).
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute freely with minimal restrictions.
last release 2024-02-15 (911 days) · last repo commit 2025-09-19 · 148 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 212,089 downloads/mo, #9,465 on PyPI
Alternatives
Verify before relying
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')- 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.
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 on it.
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
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.
Requires Graphviz system library installed; Graphviz-cairo recommended for image quality. Some features (loading table lists, reflecting indexes) only work on PostgreSQL.
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')
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 | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagessetuptoolssqlalchemypydotPillow |
| 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 |
| Classifiers | 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 |
Evidence: sqlalchemy_schemadisplay-2.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “database diagram generation”
- sqlalchemy-schemadisplayGenerates entity-relationship and UML diagrams from SQLAlchemy ORM…
- mermaid-pymermaid-py provides a Python interface to the Mermaid diagram…
- eralchemyGenerates Entity Relation (ER) diagrams from SQLAlchemy models or…
Give your agent the search over MCP, or paste the wish link into any chat.
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object Relational Mapper (ORM) that provides both a high-level ORM layer for declarative object persistence and a Core SQL construction system for direct database abstraction and query building.
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Alembic generates and manages database schema migrations for SQLAlchemy applications, handling version control of database structure changes with support for upgrades, downgrades, and auto-generation from model changes.
Install it if you use SQLAlchemy and need to version-control schema changes; skip it only if you manage migrations manually or use a different ORM entirely.
A Python client library for connecting to and querying Weaviate, a vector database that enables semantic search and AI-powered data retrieval.
A Python client library that connects to Databricks clusters and SQL warehouses using a Thrift-based protocol, conforming to the Python DB API 2.0 specification and supporting Arrow-based data exchange.
Install it if you need to query Databricks clusters or SQL warehouses from Python.
Psycopg 3 is a PostgreSQL database adapter for Python that enables applications to connect to, query, and manage PostgreSQL databases using Python code.
Install it if you need to connect Python to PostgreSQL.
See also eralchemy · sqlacodegen · paracelsus · django-diagram · plantuml · sphinxcontrib-plantuml · sqlbag · Flask-SQLAlchemy · GeoAlchemy2