{"id":21560299,"url":"https://github.com/diceroll123/pymermaider","last_synced_at":"2026-01-14T09:04:24.333Z","repository":{"id":232159178,"uuid":"783590608","full_name":"diceroll123/pymermaider","owner":"diceroll123","description":"A Python class diagram maker compatible with Mermaid.js (and GitHub), written in Rust.","archived":false,"fork":false,"pushed_at":"2026-01-10T21:07:40.000Z","size":986,"stargazers_count":34,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T04:14:40.383Z","etag":null,"topics":["mermaid-diagrams","mermaidjs","pyo3","python","ruff","rust","rustpython"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/diceroll123.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"dice","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.paypal.me/diceroll123"}},"created_at":"2024-04-08T07:35:50.000Z","updated_at":"2026-01-10T21:07:44.000Z","dependencies_parsed_at":"2024-09-09T01:31:12.463Z","dependency_job_id":"158f22ac-4cbe-4991-867c-fb164cfb3a2b","html_url":"https://github.com/diceroll123/pymermaider","commit_stats":null,"previous_names":["diceroll123/pymermaider"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/diceroll123/pymermaider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll123%2Fpymermaider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll123%2Fpymermaider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll123%2Fpymermaider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll123%2Fpymermaider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diceroll123","download_url":"https://codeload.github.com/diceroll123/pymermaider/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll123%2Fpymermaider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["mermaid-diagrams","mermaidjs","pyo3","python","ruff","rust","rustpython"],"created_at":"2024-11-24T09:13:44.308Z","updated_at":"2026-01-14T09:04:24.328Z","avatar_url":"https://github.com/diceroll123.png","language":"Rust","funding_links":["https://ko-fi.com/dice","https://www.paypal.me/diceroll123"],"categories":["Alternative Projects"],"sub_categories":["Parameters"],"readme":"# pymermaider\n\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![image](https://img.shields.io/pypi/v/pymermaider.svg)](https://pypi.python.org/pypi/pymermaider)\n[![image](https://img.shields.io/pypi/l/pymermaider.svg)](https://github.com/diceroll123/pymermaider/blob/master/LICENSE)\n[![Actions status](https://github.com/diceroll123/pymermaider/workflows/CI/badge.svg)](https://github.com/diceroll123/pymermaider/actions)\n[![image](https://img.shields.io/pypi/pyversions/pymermaider.svg)](https://pypi.python.org/pypi/pymermaider)\n\n**[Try the online pymermaider playground!](https://diceroll123.github.io/pymermaider/)** *powered by WebAssembly* 🎉\n\n`pymermaider` is a tool written in Rust designed to generate [mermaid.js](https://github.com/mermaid-js/mermaid) class diagrams from Python code. By analyzing Python code, `pymermaider` automatically generates mermaid.js-compatible diagrams that represent the class structures, including classes, methods, attributes, and their relationships. This tool aims to simplify the documentation process for Python projects, making it easier to visualize class hierarchies and relationships.\n\n## Features\n\n- **Automatic Class Diagram Generation**: Generate detailed class diagrams from Python codebases with minimal configuration.\n- **Mermaid.js Compatibility**: Outputs diagrams in mermaid.js markdown syntax, ready to be embedded in your markdown documents or rendered using mermaid.js tools. GitHub supports this natively as you'll see below!\n\n## Installation\n\npymermaider is [available on PYPI](https://pypi.org/project/pymermaider/):\n\n```bash\n# With pip.\npip install pymermaider\n\n# With pipx.\npipx install pymermaider\n```\n\n## Usage\n\n```bash\npymermaider [OPTIONS] \u003cPATH\u003e\n```\n\n### Arguments\n\n- `\u003cPATH\u003e`\n  Path to a file or directory. Use '-' to read Python source from stdin.\n\n### Options\n\n- `-m, --multiple-files`\n  Process each file individually, outputting a mermaid file for each file. Only used when path is a directory.\n\n- `-o, --output-dir \u003cOUTPUT\u003e`\n  Output directory for mermaid files. [default: ./output]\n\n- `--output-format \u003cOUTPUT_FORMAT\u003e`\n  Output file format. [default: md] [possible values: md, mmd]\n    - *`mmd` may become the default in the future, depending on user feedback*\n\n- `--output \u003cOUTPUT\u003e`\n  Output file path. Use '-' to write to stdout. Not compatible with `--multiple-files`.\n\n- `--direction \u003cDIRECTION\u003e`\n  Class diagram direction. [default: TB] [possible values: TB, BT, LR, RL]\n\n- `--no-title`\n  Omit the title from the diagram output.\n\n- `-h, --help`\n  Display help information for the command.\n\n- `-V, --version`\n  Show the current version of `pymermaider`.\n\n### File Selection:\n\n- `--exclude \u003cFILE_PATTERN\u003e`: Excludes specific files and/or directories from being analyzed.\n- `--extend-exclude \u003cFILE_PATTERN\u003e`: Similar to `--exclude`, but adds additional files and directories to exclude on top of those already specified.\n\n#### Example for `--extend-exclude`:\n\n```bash\npymermaider /path/to/dir --extend-exclude \"**/tests/*,**/docs/*\"\n```\n\nThis command will exclude any folders within the subdirectories of `/path/to/dir` that are named `tests` or `docs`.\n\n### Export raw Mermaid to `.mmd`:\n\n```bash\npymermaider /path/to/dir --output-dir ./output --output-format mmd\n```\n\n### I/O Examples\n\n```bash\n# py file -\u003e stdout\npymermaider my_file.py --output -\n\n# stdin -\u003e stdout\ncat my_file.py | pymermaider - --output -\n\n# py file -\u003e file (raw Mermaid)\npymermaider my_file.py --output-format mmd --output diagram.mmd\n\n# directory -\u003e stdout (single combined diagram)\npymermaider ./my_project --output - \u003e diagram.md\n```\n\n---\n\n### NOTES:\n\n- Some codebases are so massive that processing the directory into one file will result in mermaid code that's too large to render. By default, it's 50,000 characters. This is a good reason for the `-m` flag. You can break class diagrams apart more easily into multiple renderings.\n\n## Example\n\nGiven a Python file `example.py` with the following content:\n\n```python\nclass Animal:\n    def __init__(self, name: str) -\u003e None:\n        self.name = name\n\nclass Dog(Animal):\n    def bark(self) -\u003e str:\n        return \"Woof!\"\n```\n\nRunning pymermaider on this file will provide:\n\n```mermaid\nclassDiagram\n    class Animal {\n        - __init__(self, name) None\n    }\n\n    class Dog {\n        + bark(self) str\n    }\n\n    Dog --|\u003e Animal\n```\n\n## Future Additions\n\n- Import/type resolution powered by [ty](https://github.com/astral-sh/ty)\n- More language support, maybe?? 😳🤔\n\n## Known Issues\n\n- methods with property-setter decorators can be confusing in the output\n\n## Contributing\n\nContributions are more than welcome, just make a PR and we'll go from there!\n\n## License\n\nThis project is licensed under the MIT license. Please see the\n[LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiceroll123%2Fpymermaider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiceroll123%2Fpymermaider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiceroll123%2Fpymermaider/lists"}