PyTreePyTree is a Visual Studio Code extension that renders interactive class inheritance trees for Python projects. For every class in the hierarchy it shows typed attributes, method signatures with parameter types and gives reference to all definitions — giving you an instant, accurate picture of any object model without leaving your editor. FeaturesSimple TreeOpen a tree focused on the class under your cursor, showing all ancestor layers above it. Trigger:
Complete TreeSame as the Simple Tree, but also scans the entire workspace to find every subclass and renders descendant layers below the focus class. Trigger:
Project TreeRenders all Python classes in the workspace at once, grouped by their connected inheritance component and laid out in a grid. Useful for getting an overview of the full object model of a project. Trigger:
Pick ClassesLets you hand-pick one or more classes from a searchable list and render them side by side in a single view. You choose the tree type (Simple or Complete) upfront, then select any number of classes from a multi-select quick-pick. Trigger: Command Palette:
Show All File PathsA checkbox in the webview header toggles file-path labels on every class box. By default, paths are hidden and only appear on hover; enabling the checkbox keeps them permanently visible — handy when navigating a large workspace with classes spread across many files. Hover IntegrationHovering over any class name in a Python file shows a small card with two clickable links — Show Class Tree and Show Complete Tree — that open the corresponding view for that class without moving your cursor to the Command Palette. Webview InteractionEvery tree view is fully interactive:
Pan position, zoom level, and the file-paths checkbox state are persisted per webview session. Color Key
Commands & Shortcuts
Requirements
No additional configuration is needed. The extension activates automatically when you open a Python file. LimitationsOnly annotated class-level attributes are shown. PyTree collects attributes declared with a type annotation at class body level ( To have an attribute appear in the tree, declare it at class level:
This is intentional: it encourages explicit, typed class design and keeps the tree uncluttered. Non-Python base classes are shown by name only. If a base class is not resolvable within the workspace (e.g. a third-party library class), PyTree displays the name without expanding its members. |



