Octoframes / jupyter_capture_output

A cellmagic that captures celloutput such as text, image or video to files.
https://octoframes.github.io/jupyter_capture_output/
MIT License
31 stars 0 forks source link

jupyter-caputure-output

A cell magic that captures jupyter cell output

JupyterLight
PyPI version

Install

Requires Python >=3.8

pip install jupyter_capture_output

Example

https://user-images.githubusercontent.com/44469195/199723257-ee428f53-d576-47be-93b9-d6ab98c46d8e.mov

import jupyter_capture_output
%%capture_text --path "foo.txt"
print("Hello World")
import matplotlib.pyplot as plt
%%capture_img --path "foo.png bar.png"
plt.plot([1,2],[10,20])
plt.show()
plt.plot([3,4],[-10,-20])
plt.show()
%%capture_img  --path "foo.jpg bar.jpg" --compression 50
plt.plot([1,2],[10,20], color = "r")
plt.show()
plt.plot([3,4],[-10,-20],color = "r")
plt.show()

Implemented

Use cases

0.0.11

0.0.10

0.0.7

Add some experimental magic, but this will likely be removed in future versions:

better regex in capture video change example images to dogs

0.0.5

Remove debugging code Add JupyterLiteDemo

0.0.4

Add Text and Video capture cell magic update example

0.0.3

Setup automatic release action.

0.0.2

Update example

0.0.1

Initial release