skillfed

treescope

Treescope: An interactive HTML pretty-printer for ML research in IPython notebooks.

treescope v0.1.10 3.0M downloads/30d#2,790 on PyPI475
Permissive license Active released

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 on this page — 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

treescope on PyPI

pip

pip install treescope

uv

uv add treescope

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 371 days since the last release
Last repo commit
First released
Downloads 3,006,234/month — #2,790 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: treescope-0.1.10-py3-none-any.whl

Intended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Tags

interactive pretty printer jupytertensor array visualizerneural network visualizationipython html renderercollapsible object inspectorml model visualizationnumpy array display
jupyter-notebookvisualizationml-research

More Artificial Intelligence packages