{"id":27240420,"url":"https://github.com/maurerle/eralchemy2","last_synced_at":"2025-04-10T19:19:04.228Z","repository":{"id":40536826,"uuid":"468932746","full_name":"maurerle/eralchemy2","owner":"maurerle","description":"Entity Relation Diagrams generation tool based on https://github.com/Alexis-benoist/eralchemy","archived":false,"fork":false,"pushed_at":"2024-07-30T07:27:46.000Z","size":1634,"stargazers_count":66,"open_issues_count":7,"forks_count":16,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-09T10:11:44.253Z","etag":null,"topics":["dot","er-diagramm","erd","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Alexis-benoist/eralchemy","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maurerle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-03-11T23:50:31.000Z","updated_at":"2024-08-05T10:33:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"1977cac3-668b-4f4d-a285-3c853548626d","html_url":"https://github.com/maurerle/eralchemy2","commit_stats":{"total_commits":333,"total_committers":27,"mean_commits":"12.333333333333334","dds":"0.48048048048048053","last_synced_commit":"f5cfbd70520ebed1862e72179d7fb689c56bc242"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurerle%2Feralchemy2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurerle%2Feralchemy2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurerle%2Feralchemy2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurerle%2Feralchemy2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maurerle","download_url":"https://codeload.github.com/maurerle/eralchemy2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281376,"owners_count":21077423,"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":["dot","er-diagramm","erd","sqlalchemy"],"created_at":"2025-04-10T19:19:03.303Z","updated_at":"2025-04-10T19:19:04.220Z","avatar_url":"https://github.com/maurerle.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![PyPI Version](https://img.shields.io/pypi/v/eralchemy2.svg)](\nhttps://pypi.org/project/eralchemy2/)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/eralchemy2.svg)](\nhttps://pypi.org/project/eralchemy2/)\n![Github Actions](https://github.com/maurerle/eralchemy2/actions/workflows/python-app.yml/badge.svg)\n\n\n# Entity relation diagrams generator\n\neralchemy2 generates Entity Relation (ER) diagram (like the one below) from databases or from SQLAlchemy models.\nWorks with SQLAlchemy \u003c 1.4 but also with versions greater than 1.4\n\n## Example\n\n![Example for a graph](https://raw.githubusercontent.com/maurerle/eralchemy2/main/newsmeme.svg?raw=true \"Example for NewsMeme\")\n\n[Example for NewsMeme](https://bitbucket.org/danjac/newsmeme)\n\n## Quick Start\n\n### Install\nTo install eralchemy2, just do:\n\n    $ pip install eralchemy2\n\n`eralchemy2` 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 eralchemy2.\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 eralchemy2\n\n### Usage from Command Line\n\n#### From a database\n\n    $ eralchemy2 -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/maurerle/eralchemy2/main/example/newsmeme.er' \u003e markdown_file.er\n    $ eralchemy2 -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    $ eralchemy2 -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    $ eralchemy2 -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    $ eralchemy2 -i 'postgresql+psycopg2://username:password@hostname:5432/databasename' -s \"schema1, schema2\"\n\n#### Specify Output Mode\n\n    $ eralchemy2 -i 'markdown_file.er' -o erd_from_markdown_file.md -m mermaid_er\n\n### Usage from Python\n\n```python\nfrom eralchemy2 import render_er\n## Draw from SQLAlchemy base\nrender_er(Base, 'erd_from_sqlalchemy.png')\n\n## Or draw from SQLAlchemy metadata\nmetadata = mapper_registry.metadata\nrender_er(metadata, 'erd_from_sqlalchemy.png')\n\n## You can also generate Mermaid ER and render it easily in markdown\nrender_er(metadata, \"mermaid_erd.md\", mode=\"mermaid_er\")\n\n## Draw from database\nrender_er(\"sqlite:///relative/path/to/db.db\", 'erd_from_sqlite.png')\n```\n\n## Architecture\n![Architecture schema](https://raw.githubusercontent.com/maurerle/eralchemy2/main/eralchemy_architecture.png?raw=true \"Architecture schema\")\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/maurerle/eralchemy2/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 deselct 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\neralchemy2 is a fork of its predecessor [ERAlchemy](https://github.com/Alexis-benoist/eralchemy) by @Alexis-benoist, which is not maintained anymore and does not work with SQLAlchemy \u003e 1.4.\nIf it is maintained again, I'd like to push the integrated changes upstream.\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\nInitial Creator: Alexis Benoist [Alexis_Benoist](https://github.com/Alexis-benoist)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaurerle%2Feralchemy2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaurerle%2Feralchemy2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaurerle%2Feralchemy2/lists"}