{"id":1819,"library":"diagrams","title":"Diagrams","description":"Diagrams is a Python library that allows users to draw cloud system architectures and other technical diagrams as code. It leverages Graphviz to render visual representations, enabling version-controlled, reproducible, and dynamic documentation for multi-cloud deployments (AWS, Azure, GCP, Kubernetes, etc.), on-premise solutions, and more. Currently at version 0.25.1, the library maintains an active release cadence with frequent updates adding new icons and features.","status":"active","version":"0.25.1","language":"en","source_language":"en","source_url":"https://github.com/mingrammer/diagrams","tags":["diagrams","architecture","cloud","graphviz","visualization","devops","infrastructure-as-code","documentation"],"install":[{"cmd":"pip install diagrams","lang":"bash","label":"Install Python package"},{"cmd":"brew install graphviz","lang":"bash","label":"Install Graphviz (macOS Homebrew)"},{"cmd":"sudo apt-get install graphviz","lang":"bash","label":"Install Graphviz (Debian/Ubuntu)"},{"cmd":"choco install graphviz","lang":"bash","label":"Install Graphviz (Windows Chocolatey)"}],"dependencies":[{"reason":"Graphviz is a required system-level dependency for rendering diagrams. It must be installed separately from the Python package.","package":"Graphviz","optional":false}],"imports":[{"symbol":"Diagram","correct":"from diagrams import Diagram"},{"note":"Node types are imported from their respective cloud/provider sub-modules (e.g., `diagrams.aws`, `diagrams.azure`, `diagrams.gcp`).","symbol":"EC2","correct":"from diagrams.aws.compute import EC2"}],"quickstart":{"code":"from diagrams import Diagram\nfrom diagrams.aws.compute import EC2\nfrom diagrams.aws.database import RDS\nfrom diagrams.aws.storage import S3\n\nwith Diagram(\"Simple Web Application\", show=False, filename=\"simple_web_app\"):\n    web_server = EC2(\"Web Server\")\n    database = RDS(\"Database\")\n    static_storage = S3(\"Static Content\")\n\n    web_server >> database\n    web_server >> static_storage\n","lang":"python","description":"This example generates a simple AWS web application diagram, saving it as 'simple_web_app.png' in the current directory without automatically opening the image."},"warnings":[{"fix":"Install Graphviz according to your OS (e.g., `brew install graphviz` on macOS, `sudo apt-get install graphviz` on Debian/Ubuntu, download installer for Windows). Ensure the `dot` executable is in your system's PATH.","message":"The `diagrams` Python package requires the Graphviz system-level tool to be installed on your operating system. Without Graphviz, diagrams cannot be rendered, and you will encounter errors. This is a common oversight.","severity":"gotcha","affected_versions":"All versions"},{"fix":"While `diagrams` itself will still function, be aware of the unnecessary dependencies. This issue is likely to be addressed in a future patch release. For production environments, consider pinning to a version prior to 0.25.1 or waiting for a fix, if this is a concern.","message":"In version 0.25.1, the `pre-commit` development dependency was incorrectly included as a runtime dependency in the PyPI package. This means `pre-commit` and its transitive dependencies will be installed for all users of the library, increasing installation size and potentially causing conflicts.","severity":"gotcha","affected_versions":"0.25.1"},{"fix":"Ensure your environment uses Python 3.9 or a newer compatible version.","message":"Diagrams requires Python 3.9 or higher. Using it with older Python versions will result in compatibility errors.","severity":"breaking","affected_versions":"< 0.25.1 (earlier versions supported Python 3.7+)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}