--- id: treescope version: "0.1.10" license: unclear license_treatment: permissive maintenance: active --- # treescope — Treescope: An interactive HTML pretty-printer for ML research in IPython notebooks. License: permissive · Maintenance: active · Downloads: 3.0M/mo ## What it is and what it does Treescope is a specialized pretty-printer for machine learning research that replaces IPython's default object renderer with an interactive HTML visualization. Instead of flat text output, it renders objects as expandable trees where you can click to drill into nested structures, automatically visualizes multi-dimensional arrays with shape and value distribution information, and adds features like copy-path buttons and type inspection mode. It was originally built for the Penzai neural network library but also works with other frameworks and plain numpy code. The package depends only on numpy and installs as a pure Python wheel, making it lightweight and easy to add to existing notebooks. It's designed as a drop-in replacement—you can either call treescope.show() on specific objects or register it globally to replace the notebook's default renderer. Configuration options let you control verbosity and abbreviation depth, and the package is actively maintained with no known security vulnerabilities. Use it for: - Inspecting large neural network model structures in notebooks to understand layer hierarchies and parameter sharing. - Visualizing high-dimensional tensor shapes and value distributions without leaving the notebook. - Debugging complex nested data structures by expanding only the parts you care about. - Quickly copying qualified paths to specific fields in rendered objects for use in code. - Rendering models from multiple frameworks with consistent interactive visualization. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Treescope is an interactive HTML pretty-printer and tensor visualizer for IPython notebooks that renders complex objects with expandable trees, faceted array visualizations, and copy-path buttons. Yes. Treescope is actively maintained, has no security issues, installs with minimal friction, and solves a real pain point for ML researchers working in notebooks. The permissive license poses no restrictions. Install it if you spend time inspecting complex objects or tensors in IPython notebooks. ## Install pip install treescope uv add treescope poetry add treescope ## Installing treescope Before you install: Low friction: pure Python wheel with only numpy as a runtime dependency. Actively maintained with recent commits and no known vulnerabilities. License in practice: Permissive license allows commercial and private use with minimal restrictions. Quickstart: pip install treescope import treescope treescope.basic_interactive_setup(autovisualize_arrays=True) # Then use treescope.show(object) or treescope.register_as_default() Requires Python 3.10 or later and an IPython notebook environment. Verify before relying: - Whether treescope works with non-notebook Python environments or only in interactive notebooks. - Performance characteristics when rendering very large or deeply nested objects. - Compatibility with specific versions of Jupyter or Colab beyond the general IPython requirement. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags interactive pretty printer jupyter, tensor array visualizer, neural network visualization, ipython html renderer, collapsible object inspector, ml model visualization, numpy array display, jupyter-notebook, visualization, ml-research [View on SkillFed](https://skillfed.io/packages/treescope) · [View on PyPI](https://pypi.org/project/treescope/)