DEV.co
Open-Source Databases · eralchemy

eralchemy

ERAlchemy is a Python tool that automatically generates Entity-Relation diagrams from databases or SQLAlchemy models. It supports multiple databases (SQLite, PostgreSQL, MySQL) and outputs to various formats including PNG, PDF, SVG, and markdown.

Source: GitHub — github.com/eralchemy/eralchemy
1.4k
GitHub stars
132
Forks
Python
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryeralchemy/eralchemy
Ownereralchemy
Primary languagePython
LicenseApache-2.0 — OSI-approved
Stars1.4k
Forks132
Open issues11
Latest releasev1.7.0 (2026-05-05)
Last updated2026-05-05
Sourcehttps://github.com/eralchemy/eralchemy

What eralchemy is

ERAlchemy provides a modular pipeline that ingests database schemas or SQLAlchemy ORM definitions, transforms them into an intermediary representation, and renders to Graphviz or markdown. It requires GraphViz as an external dependency and supports optional pygraphviz or graphviz Python bindings for diagram generation.

Quickstart

Get the eralchemy source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/eralchemy/eralchemy.gitcd eralchemy# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Database Documentation Generation

Automatically generate and maintain ER diagrams from production databases to keep documentation in sync with actual schema changes without manual updates.

SQLAlchemy Model Visualization

Visualize relationships and cardinalities in SQLAlchemy ORM models early in development to validate schema design before database deployment.

Schema Communication & Onboarding

Generate shareable diagram artifacts (PDF, PNG, SVG) for cross-team communication, technical presentations, or developer onboarding without external diagramming tools.

Implementation considerations

  • GraphViz must be installed as a system dependency (apt install graphviz libgraphviz-dev on Debian, or downloaded from graphviz.org); Python package alone is insufficient.
  • Choose between graphviz and pygraphviz Python bindings at install time via pip extras; both have different platform compatibility profiles (pygraphviz can be brittle on some systems).
  • For database introspection, use SQLAlchemy database URL format; credentials are passed at command-line or in code, so consider secret management for automated pipelines.
  • PostgreSQL connection tests require local database setup or docker-compose; CI/CD integration should mark external_db tests as optional.
  • Rendering configuration (crowfoot notation, primary key symbols, layout direction) is controlled via global config dictionary; document and version these settings if standardizing across teams.

When to avoid it — and what to weigh

  • Real-time Interactive Editing Required — ERAlchemy is a one-way generator, not an interactive editor. If you need to modify diagrams and push changes back to schema, use a specialized database design tool.
  • Complex Non-Relational Schemas — The tool is designed for SQL relational databases. If your data model is predominantly graph, document, or key-value based, ERAlchemy will not capture the full structure.
  • Minimal Python Ecosystem Integration — Requires Python, pip/conda, and external GraphViz binary installation. If your environment has no Python footprint or restricted system package access, consider web-based alternatives.
  • High-Volume Automated Schema Introspection at Scale — Performance and scalability characteristics for very large schemas (100+ tables) or frequent batch generation are not documented. Requires testing in your environment.

License & commercial use

Released under Apache License 2.0, an OSI-approved permissive license that permits commercial use, modification, and distribution with no patent retaliation clause.

Apache 2.0 is a permissive OSI license that allows commercial use without restriction. No commercial licensing, support contract, or usage fees are indicated. Use is permitted as-is; ensure compliance with Apache 2.0 attribution and liability disclaimers in production deployments.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Database credentials are passed via SQLAlchemy URLs (command-line or code), exposing them in shell history or logs. For production databases, use environment variables or secret management tools (e.g., AWS Secrets Manager, HashiCorp Vault) and audit log retention. GraphViz is an external binary—verify its integrity and keep it patched. No security policy or disclosure process is mentioned in the repository.

Alternatives to consider

SchemaCrawler

Java-based tool with broader database support and interactive reports; more heavyweight and requires JVM but offers richer enterprise features and schema evolution tracking.

DBeaver ER Diagrams

GUI-based database client with built-in ER diagram generation; no coding required but less suitable for CI/CD automation and headless environments.

pgAdmin (PostgreSQL) / MySQL Workbench

Native database clients with diagram features; tight coupling to specific databases limits portability but offers deeper introspection and design tools.

Software development agency

Build on eralchemy with DEV.co software developers

Generate professional ER diagrams directly from your database or SQLAlchemy models. Integrate into CI/CD pipelines for living schema documentation. Get started with pip install eralchemy today.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

eralchemy FAQ

Can I use ERAlchemy in a CI/CD pipeline to auto-generate schema docs?
Yes. Use the CLI (eralchemy -i <url> -o <output>) and containerize with GraphViz preinstalled. Commit output to git or upload to documentation site. Credentials must be managed via environment variables or secret injection to avoid exposure.
Does ERAlchemy support non-SQL databases (MongoDB, Neo4j, etc.)?
Not natively. The README notes potential for ORM/ODM/OGM integration due to modular architecture, but only SQLAlchemy and markdown input are implemented. Custom ORM support would require code contribution.
What is the difference between graphviz and pygraphviz extras?
graphviz is a pure-Python wrapper around the GraphViz binary; pygraphviz is a compiled binding offering direct access to GraphViz C API. graphviz is the default and more portable; pygraphviz may be faster but requires compilation and GraphViz development headers.
Can I exclude sensitive tables or columns from the diagram?
Yes. Use --exclude-tables and --exclude-columns CLI flags to filter what appears in the output before rendering.

Software development & web development with DEV.co

DEV.co helps companies turn open-source tools like eralchemy into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.

Automate Your Database Documentation

Generate professional ER diagrams directly from your database or SQLAlchemy models. Integrate into CI/CD pipelines for living schema documentation. Get started with pip install eralchemy today.