{"id":15441989,"url":"https://github.com/drivendataorg/erdantic","last_synced_at":"2026-02-16T01:54:30.257Z","repository":{"id":38072115,"uuid":"336155187","full_name":"drivendataorg/erdantic","owner":"drivendataorg","description":"Entity relationship diagrams for Python data model classes like Pydantic","archived":false,"fork":false,"pushed_at":"2025-03-11T04:59:39.000Z","size":5385,"stargazers_count":366,"open_issues_count":10,"forks_count":25,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-06T21:06:38.682Z","etag":null,"topics":["dataclasses","erd","pydantic","python"],"latest_commit_sha":null,"homepage":"https://erdantic.drivendata.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drivendataorg.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","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":"2021-02-05T03:39:58.000Z","updated_at":"2025-04-04T09:44:21.000Z","dependencies_parsed_at":"2024-02-03T05:28:05.137Z","dependency_job_id":"2aba13be-c3be-46e3-9f38-b9a63798e9d1","html_url":"https://github.com/drivendataorg/erdantic","commit_stats":{"total_commits":136,"total_committers":4,"mean_commits":34.0,"dds":0.03676470588235292,"last_synced_commit":"1d2399a3116c1f8ee97ced38732abda4759dd252"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drivendataorg%2Ferdantic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drivendataorg%2Ferdantic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drivendataorg%2Ferdantic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drivendataorg%2Ferdantic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drivendataorg","download_url":"https://codeload.github.com/drivendataorg/erdantic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625523,"owners_count":21135515,"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":["dataclasses","erd","pydantic","python"],"created_at":"2024-10-01T19:24:44.183Z","updated_at":"2026-02-16T01:54:30.250Z","avatar_url":"https://github.com/drivendataorg.png","language":"Python","readme":"# erdantic: Entity Relationship Diagrams\n\n[![Docs Status](https://img.shields.io/badge/docs-stable-informational)](https://erdantic.drivendata.org/)\n[![PyPI](https://img.shields.io/pypi/v/erdantic.svg)](https://pypi.org/project/erdantic/)\n[![conda-forge](https://img.shields.io/conda/vn/conda-forge/erdantic.svg)](https://anaconda.org/conda-forge/erdantic)\n[![conda-forge feedstock](https://img.shields.io/badge/conda--forge-feedstock-yellowgreen)](https://github.com/conda-forge/erdantic-feedstock)\n[![tests](https://github.com/drivendataorg/erdantic/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/drivendataorg/erdantic/actions/workflows/tests.yml?query=branch%3Amain)\n[![codecov](https://codecov.io/gh/drivendataorg/erdantic/branch/main/graph/badge.svg)](https://codecov.io/gh/drivendataorg/erdantic)\n\n**erdantic** is a simple tool for drawing [entity relationship diagrams (ERDs)](https://en.wikipedia.org/wiki/Data_modeling#Entity%E2%80%93relationship_diagrams) for Python data model classes. Diagrams are rendered using the [Graphviz](https://graphviz.org/) library. Supported data modeling frameworks are:\n\n- [Pydantic V2](https://docs.pydantic.dev/latest/)\n- [Pydantic V1 legacy](https://docs.pydantic.dev/latest/migration/#continue-using-pydantic-v1-features)\n- [attrs](https://www.attrs.org/en/stable/)\n- [msgspec](https://jcristharif.com/msgspec/)\n- [dataclasses](https://docs.python.org/3/library/dataclasses.html) from the Python standard library\n\nWe also support [D2](https://d2lang.com/) as an alternative output format.\n\nYou can use erdantic either as a convenient CLI or as a Python library. Great for adding a simple and clean data model reference to your documentation.\n\n\u003cobject type=\"image/svg+xml\" data=\"https://raw.githubusercontent.com/drivendataorg/erdantic/refs/heads/main/docs/docs/assets/example_diagram.svg\" width=\"100%\" typemustmatch\u003e\u003cimg alt=\"Example diagram created by erdantic\" src=\"https://raw.githubusercontent.com/drivendataorg/erdantic/refs/heads/main/docs/docs/assets/example_diagram.svg\"\u003e\u003c/object\u003e\n\nType annotations are formatted using the [typenames](https://github.com/drivendataorg/typenames) library.\n\n## Installation\n\nerdantic's graph modeling depends on [pygraphviz](https://pygraphviz.github.io/documentation/stable/index.html) and [Graphviz](https://graphviz.org/), an open-source C library. If you are on Linux or macOS, the easiest way to install everything together is to use conda and conda-forge:\n\n```bash\nconda install erdantic -c conda-forge\n```\n\nIf not using conda, Graphviz must be installed first (before you can install pygraphviz). For recommended options and installation troubleshooting, see the [pygraphviz docs](https://pygraphviz.github.io/documentation/stable/install.html). Then to install erdantic and its Python dependencies from PyPI:\n\n```bash\npip install erdantic\n```\n\n### Development version\n\nYou can get the development version from GitHub with:\n\n```bash\npip install \"erdantic @ git+https://github.com/drivendataorg/erdantic.git\"\n```\n\nSee [pip's documentation](https://pip.pypa.io/en/stable/topics/vcs-support) for more on how to specify VCS dependencies.\n\n## Quick usage\n\nFirst, make sure that the data model classes that you want to include in your diagram are importable. This means the code with your models should either be available on your [`sys.path`](https://docs.python.org/3/library/sys_path_init.html) or installed into the same virtual environment as erdantic.\n\nThe fastest way to produce a diagram like the above example is to use the erdantic CLI. Simply specify the full dotted import path to your model and an output file path. The rendered format is interpreted from the filename extension.\n\n```bash\nerdantic erdantic.examples.pydantic.Party -o diagram.png\n```\n\nYou can also import the erdantic Python library. This lets you inspect the diagram data and potentially modify it. You will have greater ability to customize the diagram in Python.\n\n```python\nimport erdantic as erd\nfrom erdantic.examples.pydantic import Party\n\n# Easy one-liner\nerd.draw(Party, out=\"diagram.png\")\n\n# Or create a diagram object that you can inspect and do stuff with\ndiagram = erd.create(Party)\nlist(diagram.models.keys())\n#\u003e [ 'erdantic.examples.pydantic.Adventurer',\n#\u003e   'erdantic.examples.pydantic.Party',\n#\u003e   'erdantic.examples.pydantic.Quest',\n#\u003e   'erdantic.examples.pydantic.QuestGiver']\ndiagram.draw(\"diagram.png\")\n```\n\nCheck out the \"Usage Examples\" section of our [docs](https://erdantic.drivendata.org/) to see more.\n","funding_links":[],"categories":["Utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrivendataorg%2Ferdantic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrivendataorg%2Ferdantic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrivendataorg%2Ferdantic/lists"}