$ show krassowski/jupyter-manim
jupyter-manim is a Jupyter/IPython extension that provides a `%%manim` cell magic for rendering Manim animations and displaying the resulting video or GIF inline in notebooks. It integrates with the manimlib library (specifically the Cairo backend) to execute scene definitions defined in notebook cells, handles exporting notebook variables to the Manim script via pickling, extracts imports from the notebook's global scope, and captures Manim's output to locate and display the generated media file. The architecture centers around the `ManimMagics` class in `jupyter_manim/__init__.py`, which orchestrates the execution flow: executing cell code for early feedback, preparing a temporary script with exported variables and imports, invoking manimlib.main(), and rendering the output using IPython's display system. While the project is functional and serves its niche purpose well, it shows signs of technical drift through inconsistent versioning between setup.py and __init__.py, lack of testing on modern Python versions (only 3.6 and 3.7 in CI), and an aging Travis CI configuration. The codebase contains several reusable utilities such as StringIOWithCallback for stdout capture, is_pickable for safe serialization checks, find_ipython_frame for accessing the user namespace, and video/gif helpers for media display, which demonstrate solid craftsmanship and could be extracted for use in other Jupyter extensions.
The LLM identified 1 files worth highlighting for reuse:
Contains multiple reusable utilities for Jupyter/IPython extensions: StringIOWithCallback captures stdout line-by-line via a callback (used to detect Manim's output path), is_pickled safely checks serializability without side effects, find_ipython_frame locates the user namespace in the stack for variable export, and video/gif functions generate HTML tags for displaying media. These components are decoupled from Manim-specific logic, depend only on the standard library and IPython, and can be extracted with minimal modification for use in other projects requiring similar functionality.