eralchemy
Simple entity relation (ER) diagrams generation
What it is and what it does
eralchemy reads database schemas or SQLAlchemy ORM models and generates visual Entity Relation diagrams. It accepts input from live databases (via SQLAlchemy connection URLs), SQLAlchemy declarative bases, or markdown-format ER files, then outputs diagrams as PNG, PDF, SVG, or markdown. The tool includes a command-line interface for batch processing and a Python API for programmatic use, with options to filter tables and columns, select database schemas, and customize diagram rendering (crowfoot notation, primary key markers, layout direction).
The package depends only on sqlalchemy at runtime; graphviz or pygraphviz must be installed separately to generate image output. It supports filtering by table name and column name, schema selection for multi-schema databases, and output format selection including mermaid diagram syntax. The modular architecture is designed to eventually support other ORMs beyond SQLAlchemy.
Use it for:
- Generate visual documentation of an existing PostgreSQL or SQLite database schema for team reference
- Export a SQLAlchemy ORM model as a diagram to include in project documentation or design reviews
- Create filtered ER diagrams excluding system or audit tables from a large production database
- Convert markdown ER specifications into visual diagrams for stakeholder presentation
- Batch-generate schema diagrams from multiple databases using the command-line interface
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates Entity Relation (ER) diagrams from SQLAlchemy models or existing databases, outputting to image, PDF, or markdown formats.
Yes. Active maintenance, no known vulnerabilities, low install friction, and a single stable runtime dependency make this a safe choice. The Apache-2.0 license is permissive. Install it if you need to visualize database schemas or SQLAlchemy models; the GraphViz system dependency is the only real prerequisite.
Install
eralchemy on PyPI
pip
pip install eralchemyuv
uv add eralchemypoetry
poetry add eralchemyInstalling eralchemy
Before you install
Low friction install with a single runtime dependency (sqlalchemy). Active maintenance with recent commits and stable production status.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install eralchemy
pip install eralchemy[graphviz]
from eralchemy import render_er
render_er("sqlite:///path/to/db.db", 'erd_output.png')
Requires GraphViz system library installed (apt install graphviz libgraphviz-dev on Debian, or available for Windows/Mac/Linux from graphviz.org). Python >=3.10 required.
Verify before relying
- Whether pygraphviz extra works reliably on all platforms (graphviz extra is noted as default when both installed)
- Performance characteristics with very large schemas or databases
- Completeness of markdown-to-diagram round-trip fidelity
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — sqlalchemy |
| Maintenance | actively maintained — 101 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,938,903/month — #2,442 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: eralchemy-1.7.0-py3-none-any.whl
Keywords: sql, ORM, relational databases, ER diagram, render
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
paracelsusParacelsus generates Entity Relationship…
permissive · top 15,000 on PyPI
sqlalchemy-schemadisplayGenerates entity-relationship and UML diagrams…
permissive · top 15,000 on PyPI
django-diagramGenerates Entity Relationship Diagrams in…
unclear · top 15,000 on PyPI
sqlalchemy-pgspiderProvides a SQLAlchemy dialect that enables…
permissive · top 15,000 on PyPI
alembic_utilsExtends Alembic to autogenerate database…
permissive · top 5,000 on PyPI
sqlacodegenReads an existing database schema and generates…
permissive · top 5,000 on PyPI
sqlalchemy-mixinsProvides Active Record-style mixins for…
permissive · top 15,000 on PyPI
SQLAlchemySQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
graphvizGenerates DOT language source code for graph…
permissive · top 1,000 on PyPI
sqlbagsqlbag provides a collection of SQLAlchemy…
unclear · top 15,000 on PyPI