Proposal: Native Runtime Execution Mapping for Python Development

The Core Concept
I am proposing a standardized way to generate Runtime Execution Maps natively in Python. The goal is to move beyond text-based tracebacks and logs, creating an interactive visual flow (Sequence Diagrams) of how data moves between functions during a live execution.

The Problem
As Python projects grow in complexity, the mental overhead to track state changes increases. Standard debuggers are “line-focused,” but they don’t provide a “macro-view” of the architecture’s behavior. Developers often spend hours adding print() statements just to visualize a flow that a tool could draw automatically.

How it would work
The tool would leverage a high-level API over the tracing system to:

  1. Capture Interaction: Map every function call and its entry/exit arguments.
  2. Logic Filtering: Automatically exclude standard library noise to focus on the developer’s business logic.
  3. Visual Output: Export the execution trace into an industry-standard format (like Mermaid.js) that can be viewed in any browser.

Key Benefits

  • Onboarding: New developers can run a test and see a “map” of how the codebase works instantly.
  • Audit: Visualizing where data travels across different modules.
  • Educational: A powerful tool for students to understand the Call Stack and recursion visually.

Status
I have a functional Proof of Concept (PoC) that generates interactive HTML diagrams. I would like to discuss if the community sees value in a tool like this becoming a standard part of the Python development workflow.

What are your thoughts on having “Visual Trace” as a standard capability?

This sounds like it could be useful. Provide a link to your project so people can try it and give you feedback.
I’m not sure what you mean by “standard”: it is very difficult to get new tools added to the CPython core code. But it doesn’t need to be. There are many tools that are widely used and considered standard as in, “of course we use XYZ, everyone uses XYZ”. See pytest for example.
Publish your tool for people to use, you will get feedback.

1 Like

Hi Ned, thank you for the advice. I’ve followed your suggestion and published the project. It’s now available for the community to test and provide feedback.

​Here is the link to the repository: GitHub - Hans-developer/flowlens: FlowLens es un motor de rastreo para Python diseñado para auditar la ejecución lógica de algoritmos. Transforma la ejecución de código en un reporte HTML interactivo que permite visualizar el flujo de procesos, tiempos de respuesta y la naturaleza de cada operación. · GitHub

You might want to include an english translation to widen the audience.

​"Hi Barry, thank you for the suggestion! I’ve updated the repository and the README to include an English version to reach a broader audience. I appreciate your feedback."

1 Like

Are you planning to release on PyPI?

Hi Barry, yes, that is definitely the goal. Now that the code is localized in English, I’m working on the packaging details to publish it on PyPI soon. I’ll let you know as soon as it’s available for pip install!

1 Like