{"id":29125356,"url":"https://github.com/Alexis-benoist/eralchemy","last_synced_at":"2025-06-29T22:02:22.215Z","repository":{"id":31256799,"uuid":"34818433","full_name":"eralchemy/eralchemy","owner":"eralchemy","description":"Entity Relation Diagrams generation tool","archived":false,"fork":false,"pushed_at":"2025-04-30T22:09:59.000Z","size":1714,"stargazers_count":1243,"open_issues_count":16,"forks_count":122,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-06-27T00:14:28.027Z","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}},"created_at":"2015-04-29T21:07:23.000Z","updated_at":"2025-06-26T14:10:55.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":26,"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","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262674930,"owners_count":23346739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2025-06-29T22:01:23.674Z","updated_at":"2025-06-29T22:02:21.842Z","avatar_url":"https://github.com/eralchemy.png","language":"Python","funding_links":[],"categories":["Data Modeling and Schema Design","Python","Tools","Compiled list","\u003ca name=\"tools\"\u003e\u003c/a\u003eTools","Utilities","Schema"],"sub_categories":["plv8:","Diagrams"],"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## 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 .[ci,dev]\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 `$ tox`.\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%2FAlexis-benoist%2Feralchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlexis-benoist%2Feralchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexis-benoist%2Feralchemy/lists"}