skillfed

eralchemy

Simple entity relation (ER) diagrams generation

eralchemy v1.7.0 3.9M downloads/30d#2,442 on PyPI1,424
Permissive license Apache-2.0 Active released

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 eralchemy

uv

uv add eralchemy

poetry

poetry add eralchemy

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentTopic :: DatabaseTopic :: Scientific/Engineering :: VisualizationTopic :: Software Development :: Libraries :: Python Modules

Tags

ER diagram generatordatabase schema visualizationSQLAlchemy diagramentity relationship diagramdatabase visualization toolschema to diagramrelational database diagram
schema-visualizationdatabase-tools

More Python Modules packages