A Python package that visualizes data structures, references, and mutability to aid debugging and teaching.
Memory Graph is a Python package that creates visual graphs of data structures to illustrate references, mutability, and copying behavior. It helps developers debug complex data and understand Python's memory model by showing how variables share or copy values.
Python developers and educators who need to debug data structures, teach Python's data model, or visualize references and mutability in their code.
It provides an intuitive visual representation of Python's memory model that plain text output cannot, with deep integration into popular debuggers and support for a wide range of data types and custom configurations.
Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy.
Supports a wide range of Python types from basic lists to numpy arrays and PyTorch tensors, with clear graphs showing references and mutability. Evidence includes the 'Key Features' section and examples like binary trees and hash sets.
Seamlessly works with popular debuggers like VS Code and PyCharm via watch expressions, and offers specific functions for different environments. The README shows gifs and details for setup in various IDEs.
Clearly illustrates mutability, shallow vs deep copies, and call stack behavior with interactive examples. Sections like 'Python Data Model' include step-by-step visualizations for teaching concepts.
Allows rendering to multiple formats (PDF, SVG, etc.) and extensive customization of graph appearance via a config object. The Configuration section lists over a dozen adjustable parameters for depth, colors, and node types.
Requires separate installation of Graphviz, adding complexity to setup and potential compatibility issues across platforms, as noted in the Installation section.
The extensive configuration options, while powerful, can be overwhelming for casual users or beginners, requiring time to learn for advanced customization beyond defaults.
Exclusively targets Python data structures, making it unsuitable for projects involving other programming languages or needing cross-language debugging tools.
Graph generation for very large or deep data structures may be slow or memory-intensive, hinted at by the need for graph depth limits and slicing in the 'Graph Depth' section.
memory_graph is an open-source alternative to the following products:
Sampling profiler for Python programs
Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
🍦 Never use print() to debug again.
A toolbar overlay for debugging Flask applications
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.