Swarmauri Tool Jupyter Clear Output
Removes outputs and execution counts from Jupyter notebooks using a Swarmauri tool wrapper. Ideal for cleaning notebooks before publishing or committing to version control.
Features
- Clears output arrays from all code cells and resets
execution_counttoNone. - Leaves markdown and raw cells untouched.
- Works with notebooks already loaded into memory (dict/JSON structure).
Prerequisites
- Python 3.10 or newer.
- Dependencies:
nbconvert,swarmauri_base,swarmauri_standard(installed automatically).
Installation
# pip
pip install swarmauri_tool_jupyterclearoutput
# poetry
poetry add swarmauri_tool_jupyterclearoutput
# uv (pyproject-based projects)
uv add swarmauri_tool_jupyterclearoutput
Quickstart
import json
from swarmauri_tool_jupyterclearoutput import JupyterClearOutputTool
notebook_data = json.loads(Path("notebooks/example.ipynb").read_text())
cleaner = JupyterClearOutputTool()
clean_notebook = cleaner(notebook_data)
Path("notebooks/example-clean.ipynb").write_text(json.dumps(clean_notebook, indent=2))
Tips
- Run this tool before committing notebooks to keep diffs small and avoid leaking secrets in output cells.
- Combine with Swarmauri pipelines that regenerate notebooks (e.g., parameterized runs) to ensure clean artifacts.
- For large notebooks, consider streaming to disk rather than loading entirely into memory before clearing.
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Metadata
Release files for swarmauri_tool_jupyterclearoutput 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_tool_jupyterclearoutput-0.10.0.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_tool_jupyterclearoutput-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.6 kB
Release files / swarmauri_tool_jupyterclearoutput-0.10.0.tar.gz
| Download URL | swarmauri_tool_jupyterclearoutput-0.10.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68b8654d960e186ac466c811464a4b81a37e7c86d3598f77ad6c0b1dbef5989f
|
|
BLAKE2b-256 checksum How to use checksums |
223f5c7e83964d94424f5ba77e25459323af1e1cdd693c2fcecf049e47b94a4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_tool_jupyterclearoutput-0.10.0-py3-none-any.whl
| Download URL | swarmauri_tool_jupyterclearoutput-0.10.0-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49b5a42ae38710c22c2dc020ebd1d936219057a373d457204aff6e460c364d0b
|
|
BLAKE2b-256 checksum How to use checksums |
a734f0ee350a06208b6deef71fa2d035898f2e0e360fb231fa84777769e1a172
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|