Capture output from JupyterLab
Project description
jupyter-caputure-output
A cell magic that captures jupyter cell output
Install
Requires Python >=3.8
pip install jupyter_capture_output
Example
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
%%capture_text
-> to .txt file with text output%%capture_img
-> to .png or .jpg with image output%%capture_video
-> to .mp4 file with the video output
Wishlist
%%capture_svg
-> to .svg file with svg vectorgraphic outout%%capture_numpy_array
-> to .np file with array%%capture_csv
-> to .csv with datapoints%%capture_gif
-> to .gif with animation%%capture_auto
-> automatically detects what output there is to capture
Changelog
0.0.8
- Add
capture_code
magic. Because this is not cell output but cell content, it might be worth to think about renaming this project fromcapture-output
to onlycapture
or evencapture-content
. remove experimental_capture_video_first_last
andexperimental_video_thumbnail
again. This package is not the right place for that.
0.0.7
- Add relative path support and automatically create paths if they don't exist yet.
Add some experimental magic, but this will likely be removed in future versions:
-
experimental_capture_video_first_last
captures video and extracts first and last frame from it. Useful for post-processing of videos in other video editors. Needs ffmpeg installed
-
experimental_video_thumbnail
extracts video from the Jupyter cell output, and replaces it with an image thumbnail of the video -> useful for Version control. Needs matplotlib and ffmpeg installed
0.0.6
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jupyter_capture_output-0.0.8.tar.gz
.
File metadata
- Download URL: jupyter_capture_output-0.0.8.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.15 Linux/5.15.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 314a42d803c7db494118650e5eb4df1379ad74f379ddbbfc7a3feed996b480b4 |
|
MD5 | 864277e6142d4fd7282301657f72342d |
|
BLAKE2b-256 | 8f5abf30675b3a910b50fc6deb76e4cc3d3e512ca53df532e4d05f99c3f518d5 |
File details
Details for the file jupyter_capture_output-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: jupyter_capture_output-0.0.8-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.15 Linux/5.15.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4399c0a0352b468a8a122b5432270c708e6133751ae40dad72b4ea909f2dca0 |
|
MD5 | 6c8c942d82ba2bf94ff7f8b27d09d1f7 |
|
BLAKE2b-256 | e2541022df6a4a3631cbb896ada92392ed802151f87dc8d2c9e47954d2bb8322 |