{"id":37231094,"url":"https://github.com/sidorov-as/c4-diagrams","last_synced_at":"2026-02-01T15:01:25.717Z","repository":{"id":331847271,"uuid":"1005426374","full_name":"sidorov-as/c4-diagrams","owner":"sidorov-as","description":"C4 model as Code","archived":false,"fork":false,"pushed_at":"2026-01-22T17:11:42.000Z","size":2855,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-23T09:57:34.189Z","etag":null,"topics":["diagram","diagram-as-code","plantuml"],"latest_commit_sha":null,"homepage":"https://sidorov-as.github.io/c4-diagrams/","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/sidorov-as.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-20T07:59:21.000Z","updated_at":"2026-01-22T17:00:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sidorov-as/c4-diagrams","commit_stats":null,"previous_names":["sidorov-as/c4-diagrams"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sidorov-as/c4-diagrams","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorov-as%2Fc4-diagrams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorov-as%2Fc4-diagrams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorov-as%2Fc4-diagrams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorov-as%2Fc4-diagrams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidorov-as","download_url":"https://codeload.github.com/sidorov-as/c4-diagrams/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorov-as%2Fc4-diagrams/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28980855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T13:38:33.235Z","status":"ssl_error","status_checked_at":"2026-02-01T13:38:32.912Z","response_time":56,"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":["diagram","diagram-as-code","plantuml"],"created_at":"2026-01-15T03:41:40.117Z","updated_at":"2026-02-01T15:01:25.697Z","avatar_url":"https://github.com/sidorov-as.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- begin logo --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/sidorov-as/c4-diagrams/\"\u003e\n    \u003cimg src=\"https://sidorov-as.github.io/c4-diagrams/assets/c4-diagrams-logo.png\" alt=\"c4-diagrams logo\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eA Python DSL for C4 model diagrams.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003c!-- end logo --\u003e\n\n# c4-diagrams\n\n[![Release](https://img.shields.io/pypi/v/c4-diagrams.svg)](https://pypi.org/project/c4-diagrams/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/c4-diagrams)](https://pypi.org/project/c4-diagrams/)\n[![Build status](https://img.shields.io/github/actions/workflow/status/sidorov-as/c4-diagrams/main.yml?branch=main)](https://github.com/sidorov-as/c4-diagrams/actions/workflows/main.yml?query=branch%3Amain)\n[![Maintainability](https://qlty.sh/gh/sidorov-as/projects/c4-diagrams/maintainability.svg)](https://qlty.sh/gh/sidorov-as/projects/c4-diagrams)\n[![Code Coverage](https://qlty.sh/gh/sidorov-as/projects/c4-diagrams/coverage.svg)](https://qlty.sh/gh/sidorov-as/projects/c4-diagrams)\n[![License](https://img.shields.io/github/license/sidorov-as/c4-diagrams)](https://img.shields.io/github/license/sidorov-as/c4-diagrams)\n\n**c4-diagrams** is a Python DSL for defining **[C4 model](https://c4model.com/) architecture diagrams as code**.\n\nThe package provides first-class abstractions for C4 entities — people, systems, containers, components, boundaries,\nand relationships — allowing you to describe software architecture in Python and render it into multiple diagram formats.\n\n## Features\n\n- Declarative Python DSL for C4 modeling\n- First-class C4 entities and relationships\n- Multiple rendering backends\n- Suitable for documentation, ADRs, and architecture reviews\n- Renderer-agnostic DSL (same code → different outputs)\n\n## Rendering backends\n\nCurrently supported and planned backends:\n\n- [**PlantUML**](https://github.com/plantuml-stdlib/C4-PlantUML)\n  - local rendering via `plantuml` CLI or `plantuml.jar`\n  - remote rendering via PlantUML server\n- [**Mermaid**](https://mermaid.js.org/syntax/c4.html) — WIP\n- [**Structurizr**](https://structurizr.com/) — WIP\n\n## Getting started\n\n**c4-diagrams** requires **Python 3.10** or higher.\n\n```shell\n# using pip (pip3)\n$ pip install c4-diagrams\n\n# using pipenv\n$ pipenv install c4-diagrams\n\n# using poetry\n$ poetry add c4-diagrams\n\n# using uv\n$ uv add c4-diagrams\n```\n\n## Minimal example\n\nA minimal system context diagram defined in Python:\n\n```python\nfrom c4 import Person, Rel, System, SystemContextDiagram\n\nwith SystemContextDiagram(\"Example system context\") as diagram:\n    user = Person(label=\"User\", description=\"System user\")\n    backend = System(label=\"Backend API\", description=\"Main application backend\")\n\n    user \u003e\u003e Rel(\"Uses HTTP API\") \u003e\u003e backend\n\nprint(diagram.as_plantuml())\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eGenerated PlantUML source\u003c/summary\u003e\n\n```puml\n@startuml\n' convert it with additional command line argument -DRELATIVE_INCLUDE=\"relative/absolute\" to use locally\n!if %variable_exists(\"RELATIVE_INCLUDE\")\n    !include %get_variable_value(\"RELATIVE_INCLUDE\")/C4_Context.puml\n!else\n    !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml\n!endif\n\ntitle Example system context\n\nPerson(user_91e7, \"User\", \"System user\")\n\nSystem(backend_api_610a, \"Backend API\", \"Main application backend\")\n\nRel(user_91e7, backend_api_610a, \"Uses HTTP API\")\n\n@enduml\n```\n\n\u003c/details\u003e\n\n## Examples\n\n| System context diagram                                    | Container Diagram                                       | Component Diagram                                       |\n|-----------------------------------------------------------|---------------------------------------------------------|---------------------------------------------------------|\n| ![system context](https://sidorov-as.github.io/c4-diagrams/assets/system-context-diagram.png) | ![container diagram](https://sidorov-as.github.io/c4-diagrams/assets/container-diagram.png) | ![component diagram](https://sidorov-as.github.io/c4-diagrams/assets/component-diagram.png) |\n\n## Project Links\n\n- [**PyPI**](https://pypi.org/project/c4-diagrams/)\n- [**GitHub**](https://github.com/sidorov-as/c4-diagrams/)\n- [**Documentation**](https://sidorov-as.github.io/c4-diagrams/)\n- [**Changelog**](https://github.com/sidorov-as/c4-diagrams/tree/main/CHANGELOG.md)\n\n## License\n\n* [MIT LICENSE](https://github.com/sidorov-as/c4-diagrams/blob/main/LICENSE)\n\n## Contribution\n\n[Contribution guidelines for this project](https://github.com/sidorov-as/c4-diagrams/blob/main/CONTRIBUTING.md)\n\n---\n\nRepository initiated with [fpgmaas/cookiecutter-uv](https://github.com/fpgmaas/cookiecutter-uv).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidorov-as%2Fc4-diagrams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidorov-as%2Fc4-diagrams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidorov-as%2Fc4-diagrams/lists"}