A Swarmauri tool designed to export Jupyter Notebooks to Markdown.
Project description
Swarmauri Tool Jupyter Export Markdown
Converts a Jupyter NotebookNode to Markdown using nbconvert’s MarkdownExporter. Injectable CSS and JS snippets let you tweak the output for static publishing.
Features
- Accepts a notebook JSON string and returns rendered Markdown.
- Optional inline CSS/JS injection to customize the exported document.
- Returns a dict with
exported_markdownorerrorif conversion fails.
Prerequisites
- Python 3.10 or newer.
- nbconvert/nbformat installed (pulled in automatically).
Installation
# pip
pip install swarmauri_tool_jupyterexportmarkdown
# poetry
poetry add swarmauri_tool_jupyterexportmarkdown
# uv (pyproject-based projects)
uv add swarmauri_tool_jupyterexportmarkdown
Quickstart
import json
import nbformat
from swarmauri_tool_jupyterexportmarkdown import JupyterExportMarkdownTool
notebook = nbformat.read("notebooks/example.ipynb", as_version=4)
notebook_json = json.dumps(notebook)
exporter = JupyterExportMarkdownTool()
response = exporter(
notebook_json=notebook_json,
extra_css="blockquote { color: gray; }",
extra_js="console.log('Markdown ready');",
)
if "exported_markdown" in response:
Path("notebooks/example.md").write_text(response["exported_markdown"], encoding="utf-8")
else:
print("Error:", response["error"])
Tips
- Use Markdown export when preparing notebooks for static docs, blogs, or README content.
- Apply lightweight CSS/JS to adjust styling when the Markdown is embedded in HTML environments.
- Combine with notebook execution tools to build pipelines (execute → convert to Markdown → publish).
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_tool_jupyterexportmarkdown-1.3.0.tar.gz.
File metadata
- Download URL: swarmauri_tool_jupyterexportmarkdown-1.3.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49a3544a23a47312ca4decca1cf392541210f5de790482a669f4534f49a7471b
|
|
| MD5 |
e110c85209e80a5542c8968f764aae48
|
|
| BLAKE2b-256 |
a4c4e0b170670a002c7d82b707039d176429de66c4232b1dfc73e9ce362d5460
|
File details
Details for the file swarmauri_tool_jupyterexportmarkdown-1.3.0-py3-none-any.whl.
File metadata
- Download URL: swarmauri_tool_jupyterexportmarkdown-1.3.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc305040c1399f3815e7bffeb46846b546c3d4e848271357797fa6ce62f9e793
|
|
| MD5 |
a216d59411580803e82f4b68c9534376
|
|
| BLAKE2b-256 |
ec6bace73879c961746f240347a551f8a0a324905db3bb11ddf4da838a563d69
|