Skip to content

Pyreverse

Dennis Lee edited this page May 27, 2026 · 1 revision

title: Pyreverse radar_quadrant: Tools radar_ring: Assess radar_position: center created: 2026-05-22 last_updated: 2026-05-22 related: ["C4ModelStructurizr"]

Pyreverse

Pyreverse is a static analysis tool bundled with Pylint that generates UML class diagrams and package dependency diagrams from Python source code. It requires no separate installation beyond pip install pylint and outputs diagrams in Graphviz DOT, PlantUML, or Mermaid format.

Key Capabilities

  • Class diagrams: All classes, attributes, methods, and inheritance relationships in a module or package
  • Package diagrams: Import dependencies between packages, useful for identifying coupling and circular imports
  • Multiple output formats: DOT (Graphviz), PlantUML, Mermaid, HTML
  • Selective scope: analyse a single module, a package, or an entire project

Usage

pyreverse -o dot -p MyProject src/
dot -Tpng classes_MyProject.dot -o classes.png

Radar Assessment

Pyreverse sits at Tools → Assess center. It is a reverse-engineering tool, not a design tool — diagrams reflect what the code does, not what it should do. Center position reflects genuine but situational utility: the primary use case is inheriting an unfamiliar Python codebase with no architecture documentation and needing to understand its structure quickly. For forward-looking architecture documentation, C4 Model and Structurizr (Trial inner) is the more appropriate choice. The remaining gate before moving inner is use on at least one real legacy codebase where the generated diagrams provided actionable architectural insight.

Clone this wiki locally