{"id":13453610,"url":"https://github.com/eralchemy/eralchemy","last_synced_at":"2026-04-08T14:32:46.651Z","repository":{"id":31256799,"uuid":"34818433","full_name":"eralchemy/eralchemy","owner":"eralchemy","description":"Entity Relation Diagrams generation tool","archived":false,"fork":false,"pushed_at":"2025-11-24T20:30:03.000Z","size":1725,"stargazers_count":1381,"open_issues_count":9,"forks_count":130,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-12-13T03:09:35.066Z","etag":null,"topics":["database","documentation-tool","mysql","postgresql","schema","sql","sqlalchemy","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eralchemy.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-04-29T21:07:23.000Z","updated_at":"2025-12-13T01:02:11.000Z","dependencies_parsed_at":"2024-01-07T12:53:06.017Z","dependency_job_id":"c3a51fe3-2c3a-49ac-a2f8-99e774093fb5","html_url":"https://github.com/eralchemy/eralchemy","commit_stats":{"total_commits":368,"total_committers":29,"mean_commits":"12.689655172413794","dds":0.5298913043478262,"last_synced_commit":"ec80be3b845ea65d480c70afe85448b77c23eec2"},"previous_names":["eralchemy/eralchemy","alexis-benoist/eralchemy"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/eralchemy/eralchemy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eralchemy%2Feralchemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eralchemy%2Feralchemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eralchemy%2Feralchemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eralchemy%2Feralchemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eralchemy","download_url":"https://codeload.github.com/eralchemy/eralchemy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eralchemy%2Feralchemy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31559829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","documentation-tool","mysql","postgresql","schema","sql","sqlalchemy","visualization"],"created_at":"2024-07-31T08:00:44.298Z","updated_at":"2026-04-08T14:32:46.627Z","avatar_url":"https://github.com/eralchemy.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![license](https://img.shields.io/badge/License-Apache%202.0-yellow?logo=opensourceinitiative\u0026logoColor=white)](LICENSE)\n[![PyPI - Version](https://img.shields.io/pypi/v/eralchemy?logo=pypi\u0026logoColor=white)](https://pypi.org/project/ERAlchemy/)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/eralchemy?logo=pypi\u0026logoColor=white)](https://pypi.org/project/eralchemy/)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/eralchemy/eralchemy/unit.yaml?logo=github\u0026logoColor=white)](https://github.com/eralchemy/eralchemy/actions/workflows/unit.yaml)\n[![Codecov](https://img.shields.io/codecov/c/github/eralchemy/eralchemy?logo=codecov\u0026logoColor=white\u0026token=gSfKRZVvAh)](https://app.codecov.io/gh/eralchemy/eralchemy/tree/main)\n\n# Entity relation diagrams generator\n\neralchemy generates Entity Relation (ER) diagram (like the one below) from databases or from SQLAlchemy models.\n\n## Example\n\n![Example for a graph](https://raw.githubusercontent.com/eralchemy/eralchemy/main/docs/_static/forum.svg \"Example for a simple Forum\")\n\n## Quick Start\n\n### Install\n\nTo install eralchemy, just do:\n\n    $ pip install eralchemy\n\n### Graph library flavors\n\nTo create Pictures and PDFs, eralchemy relies on either graphviz or pygraphviz.\n\nYou can use either\n\n    $ pip install eralchemy[graphviz]\n\nor\n\n    $ pip install eralchemy[pygraphviz]\n\nto retrieve the correct dependencies.\nThe `graphviz` library is the default if both are installed.\n\n`eralchemy` requires [GraphViz](http://www.graphviz.org/download) to generate the graphs and Python. Both are available for Windows, Mac and Linux.\n\nFor Debian based systems, run:\n\n    $ apt install graphviz libgraphviz-dev\n\nbefore installing eralchemy.\n\n### Install using conda\n\nThere is also a packaged version in conda-forge, which directly installs the dependencies:\n\n    $ conda install -c conda-forge eralchemy\n\n### Usage from Command Line\n\n#### From a database\n\n    $ eralchemy -i sqlite:///relative/path/to/db.db -o erd_from_sqlite.pdf\n\nThe database is specified as a [SQLAlchemy](https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls)\ndatabase url.\n\n#### From a markdown file.\n\n    $ curl 'https://raw.githubusercontent.com/eralchemy/eralchemy/main/example/forum.er' \u003e markdown_file.er\n    $ eralchemy -i 'markdown_file.er' -o erd_from_markdown_file.pdf\n\n#### From a Postgresql DB to a markdown file excluding tables named `temp` and `audit`\n\n    $ eralchemy -i 'postgresql+psycopg2://username:password@hostname:5432/databasename' -o filtered.er --exclude-tables temp audit\n\n#### From a Postgresql DB to a markdown file excluding columns named `created_at` and `updated_at` from all tables\n\n    $ eralchemy -i 'postgresql+psycopg2://username:password@hostname:5432/databasename' -o filtered.er --exclude-columns created_at updated_at\n\n#### From a Postgresql DB to a markdown file for the schemas `schema1` and `schema2`\n\n    $ eralchemy -i 'postgresql+psycopg2://username:password@hostname:5432/databasename' -s \"schema1, schema2\"\n\n#### Specify Output Mode\n\n    $ eralchemy -i 'markdown_file.er' -o erd_from_markdown_file.md -m mermaid_er\n\n### Usage from Python\n\n```python\nfrom eralchemy import render_er\n## Draw from SQLAlchemy base\nrender_er(Base, 'erd_from_sqlalchemy.png')\n\n## Draw from database\nrender_er(\"sqlite:///relative/path/to/db.db\", 'erd_from_sqlite.png')\n```\n\n#### Adjustments to the rendering config\n\nWhen rendering dot files, it can be needed to adjust how some parts are visualized.\nThis can be used to get `crowfoot` relations, stars instead of underlines for primary keys or a top-bottom rendering instead the default left-right rendering.\n\nIt can be adjusted by manipulating the global `from eralchemy.cst import config` dictionary.\n\nSome helper functions exist like `dot_star_primary`, `dot_top_down`, `dot_digraph` and `dot_crowfoot`.\nThe config can be reset using `reset_config`.\n\nThis can be used like\n\n```python\nfrom eralchemy import render_er\nfrom eralchemy.cst import dot_crowfoot, dot_digraph\ndot_crowfoot()\ndot_digraph()\n\nrender_er(Base, \"forum.svg\")\n```\n\n## Architecture\n\n```mermaid\n\ngraph LR\n    subgraph Inputs\n        A[Markdown representation]\n        B[SQLAlchemy Schema]\n        C[Existing database]\n        D[Other ORM ?]\n    end\n\n    E[Intermediary representation]\n\n    subgraph Outputs\n        F[Markdown representation]\n        G[Graphviz code]\n        H[Drawing]\n    end\n\n    A --\u003e E\n    B --\u003e E\n    C --\u003e E\n    D --\u003e E\n    E --\u003e F\n    E --\u003e G\n    E --\u003e H\n\n```\n\nThanks to it's modular architecture, it can be connected to other ORMs/ODMs/OGMs/O\\*Ms.\n\n## Contribute\n\nEvery feedback is welcome on the [GitHub issues](https://github.com/eralchemy/eralchemy/issues).\n\n### Development\n\nInstall the development dependencies using\n\n    $ pip install -e .[dev,test]\n\nMake sure to run the pre-commit to fix formatting\n\n    $ pre-commit run --all\n\nAll tested PR are welcome.\n\n## Running tests\n\nThis project uses the pytest test suite.\nTo run the tests, use : `$ pytest` or `$ nox`.\n\nSome tests require having a local PostgreSQL database with a schema named test in a database\nnamed test all owned by a user named eralchemy with a password of eralchemy.\nIf docker compose is available, one can use `docker compose up -d` for this purpose.\nYou can deselect the tests which require a PostgreSQL database using:\n\n    $ pytest -m \"not external_db\"\n\n## Publishing a release\n\n    $ rm -r dist \u0026\u0026 python -m build \u0026\u0026 python3 -m twine upload --repository pypi dist/*\n\n## Notes\n\nERAlchemy was inspired by [erd](https://github.com/BurntSushi/erd), though it is able to render the ER diagram directly\nfrom the database and not just only from the `ER` markup language.\n\nReleased under an Apache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feralchemy%2Feralchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feralchemy%2Feralchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feralchemy%2Feralchemy/lists"}