{"id":24787975,"url":"https://github.com/octoframes/jupyter_capture_output","last_synced_at":"2025-10-05T07:52:41.870Z","repository":{"id":38349933,"uuid":"491111212","full_name":"Octoframes/jupyter_capture_output","owner":"Octoframes","description":"A cellmagic that captures celloutput such as text, image or video to files. ","archived":false,"fork":false,"pushed_at":"2025-02-19T11:30:48.000Z","size":4478,"stargazers_count":37,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T11:41:14.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://octoframes.github.io/jupyter_capture_output/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Octoframes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-05-11T12:55:53.000Z","updated_at":"2025-03-20T16:34:08.000Z","dependencies_parsed_at":"2024-01-07T17:49:49.808Z","dependency_job_id":"ea2068a3-4b01-4e11-b0c3-6fbdb91643e3","html_url":"https://github.com/Octoframes/jupyter_capture_output","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Octoframes/jupyter_capture_output","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_capture_output","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_capture_output/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_capture_output/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_capture_output/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Octoframes","download_url":"https://codeload.github.com/Octoframes/jupyter_capture_output/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_capture_output/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278425499,"owners_count":25984686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-29T16:14:29.158Z","updated_at":"2025-10-05T07:52:41.832Z","avatar_url":"https://github.com/Octoframes.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jupyter-caputure-output\nA cell magic that captures jupyter cell output\n\n\n[![JupyterLight](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://octoframes.github.io/jupyter_capture_output/)  \n[![PyPI version](https://badge.fury.io/py/jupyter-capture-output.svg)](https://badge.fury.io/py/jupyter-capture-output)\n\n\n## Install\nRequires Python \u003e=3.8\n```py\npip install jupyter_capture_output\n```\n\n\n## Example\n\nhttps://user-images.githubusercontent.com/44469195/199723257-ee428f53-d576-47be-93b9-d6ab98c46d8e.mov\n\n```py\nimport jupyter_capture_output\n```\n\n```py \n%%capture_text --path \"foo.txt\"\nprint(\"Hello World\")\n```\n\n```py\nimport matplotlib.pyplot as plt\n```\n\n```py\n%%capture_img --path \"foo.png bar.png\"\nplt.plot([1,2],[10,20])\nplt.show()\nplt.plot([3,4],[-10,-20])\nplt.show()\n```\n\n```py\n%%capture_img  --path \"foo.jpg bar.jpg\" --compression 50\nplt.plot([1,2],[10,20], color = \"r\")\nplt.show()\nplt.plot([3,4],[-10,-20],color = \"r\")\nplt.show()\n```\n\n\n\nImplemented\n* `%%capture_text`  -\u003e  to .txt file with text output\n* `%%capture_code`  -\u003e  to .py file with cell content\n* `%%capture_img` -\u003e to .png or .jpg with image output\n* `%%capture_video` -\u003e to .mp4 file with the video output\n\n## Use cases\n\n* matplotlib, scipy, PIL , cv2, manim etc. have their own APIs to save images. With this package, one just have to learn one line of code and can use it to save all kind of image outputs made by different packages.\n\n* When tweaking plots, one can use this cell magic to track the process, so to say a visual version control system.\n\n* In context of Science, one can generate log files of experiments with this package. As the cell magic is always on the top of the cell, it's easy to see in which cells log files are generated and in which not.\n\n* This can be used to create sheet cheats, e.g. this [math-functions-cheat-sheet](https://kolibril13.github.io/plywood-gallery-functions/) website was generated from a jupyter notebook using a derivative of this capture package.\n\n* This package will also auto-generate the folder-tree of subdirectories for you.\n## Changelog\n\n### 0.0.11\n\n* add support for embedded videos.\n\n### 0.0.10\n\n* use importlib.metadata\n### 0.0.9\n\n* support python 3.11\n### 0.0.8 \n*  Add `capture_code` magic. Because this is not cell output but cell content, it might be worth to think about renaming this project from `capture-output` to only `capture` or even `capture-content`.\n* `remove experimental_capture_video_first_last` and `experimental_video_thumbnail` again. This package is not the right place for that.\n\n### 0.0.7 \n\n* Add relative path support and automatically create paths if they don't exist yet.\n\nAdd some experimental magic, but this will likely be removed in future versions:\n* * `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\n\n* `experimental_video_thumbnail` extracts video from the Jupyter cell output, and replaces it with an image thumbnail of the video -\u003e useful for Version control. Needs matplotlib and ffmpeg installed\n### 0.0.6\n\nbetter regex in capture video\nchange example images to dogs\n\n### 0.0.5\n\nRemove debugging code\nAdd JupyterLiteDemo\n### 0.0.4\n\nAdd Text and Video capture cell magic\nupdate example\n\n### 0.0.3\n\nSetup automatic release action.\n\n### 0.0.2\n\nUpdate example\n\n### 0.0.1\n\nInitial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoframes%2Fjupyter_capture_output","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctoframes%2Fjupyter_capture_output","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoframes%2Fjupyter_capture_output/lists"}