Skip to main content

🗃️ erdify

PyPI version Python versions License: MIT Tests Linting Ruff Checked with mypy PyPI Downloads

🚀 Generate beautiful PlantUML Entity Relationship Diagrams from your SQLModel, SQLAlchemy, Django, Pydantic and dataclass models automatically!

erdify parses your model files using AST (Abstract Syntax Tree) and generates comprehensive ERD diagrams in PlantUML format. It supports SQLModel, SQLAlchemy 2.0, Django ORM, Pydantic and standard-library dataclasses — and raw SQL DDL files (.sql) via the optional erdify[sql] extra. No database connection required!

✨ Features

  • 🧬 5 Python Frameworks + SQL DDL - SQLModel, SQLAlchemy 2.0, Django ORM, Pydantic, dataclasses, and raw .sql files (via erdify[sql])
  • 🔍 AST-Based Parsing - No imports needed, works with any valid Python code
  • 🎯 Zero dependencies by default — core uses only the stdlib; SQL support is an opt-in extra (erdify[sql])
  • 🔗 Relationship Detection - Foreign keys, relationships and many-to-many link tables
  • 🧜 4 Output Formats - --format emits PlantUML, Mermaid (renders natively on GitHub), JSON, or a self-contained HTML preview
  • 📝 Markdown Embed - --inject writes the diagram into a Markdown file between markers
  • ⚙️ Config File - Store options under [tool.erdify] in pyproject.toml
  • Drift Check - --check fails CI/pre-commit when the committed diagram is stale

See the full feature matrix for everything erdify recognizes.

🚀 Quick Start

# Run without installing (or `pip install erdify`)
uvx erdify ./src/database -o erd.puml
# Output to stdout, with a custom title
erdify ./src/models --title "My Database Schema"

See the documentation for installation options, the full CLI, the Python API and more.

🧬 One Schema, Five Frameworks

The same User / Order schema in SQLModel, SQLAlchemy 2.0, Django, Pydantic and dataclasses — only the syntax differs. Each one produces the identical diagram:

Framework comparison ERD

👉 See the full side-by-side comparison and the detection/parsing table in the Frameworks Overview (with a worked example and Django specifics). The runnable sources live in docs/examples/.

📚 Documentation

📋 Supported Features

Primary/foreign keys, nullable fields, defaults, indexes, enums, relationships, inheritance, link tables, custom table names and per-framework specifics — see the full feature matrix in the docs.

💬 Community

Questions, ideas, or want to show off an ERD erdify generated? Join the Discussions. For open-ended topics and feature direction, Discussions are the place; concrete bugs and proposals go to Issues.

🤝 Contributing

Contributions are welcome! Have a bug or a concrete feature request? Please open an issue, and see CONTRIBUTING.md for guidelines. Shipped changes are tracked in the changelog.

🔒 Security

For security concerns, please see SECURITY.md.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

erdify stands on the shoulders of great open-source projects:

Supported model frameworks

  • SQLModel - The awesome SQL database library
  • SQLAlchemy - The Python SQL toolkit and ORM
  • Django - The web framework whose ORM models erdify parses
  • Pydantic - Data validation using Python type hints
  • dataclasses - Python standard-library data classes

Rendering & output

  • PlantUML - For the diagram rendering
  • Graphviz - Layout engine behind PlantUML's ER diagrams
  • Mermaid - Renders the --format mermaid / html output

Tooling & infrastructure

  • uv - Packaging, builds and dependency management
  • Ruff - Linting and formatting
  • mypy - Static type checking
  • pytest - Testing framework
  • pre-commit - Git hook management

Community


Created & maintained with ❤️ by devsuit GmbH

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

erdify-0.11.3.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

erdify-0.11.3-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file erdify-0.11.3.tar.gz.

File metadata

  • Download URL: erdify-0.11.3.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for erdify-0.11.3.tar.gz
Algorithm Hash digest
SHA256 f41848a0350991e110ab4f10b2b2bdd01a10516849fff7cc76acd5b171e7b415
MD5 2a7d592c6800d0624ebe87c3270ab4da
BLAKE2b-256 9068bf2abc7a84756de1cf5890cdce008c79db987c517d1f5b03d2d49ec1432f

See more details on using hashes here.

File details

Details for the file erdify-0.11.3-py3-none-any.whl.

File metadata

  • Download URL: erdify-0.11.3-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for erdify-0.11.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61b410b6ec48f621cfc1aac98fd85714e81e93b302e8c8153f8afa7eab8faf2d
MD5 36b905b8e6d233727aacf6cae97422b5
BLAKE2b-256 2536202bf859a764c45e97ebd05513a27c0a3673e73742edfad58226eb6dd901

See more details on using hashes here.

Release history Release notifications | RSS feed

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

0.12.3

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.5

2 files

0.11.4

2 files

This release

0.11.3 This release

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page