Skip to main content

A Swarmauri tool designed to export Jupyter Notebooks to Markdown.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupyterexportmarkdown


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_markdown or error if 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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_tool_jupyterexportmarkdown-1.3.2.dev6.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupyterexportmarkdown-1.3.2.dev6.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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

Hashes for swarmauri_tool_jupyterexportmarkdown-1.3.2.dev6.tar.gz
Algorithm Hash digest
SHA256 5b998a4be09dd5ec6e2600766b73a56abdfb6dd320177a3a696b553459097e80
MD5 ae7329e4530e2c38f1c2063be036d0db
BLAKE2b-256 8e1bafa2150e44ed9f2bd41cefb7811d23919635c114bdf0df4a3e096916f847

See more details on using hashes here.

File details

Details for the file swarmauri_tool_jupyterexportmarkdown-1.3.2.dev6-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_jupyterexportmarkdown-1.3.2.dev6-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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

Hashes for swarmauri_tool_jupyterexportmarkdown-1.3.2.dev6-py3-none-any.whl
Algorithm Hash digest
SHA256 d833099747b84a73d097624c4c44aff764038e3eefe6562687e36b0e473c46a7
MD5 c935940aea5fc42d4d9f806fd2382505
BLAKE2b-256 eb5b6f2aa1e9ee79b5cc79af3c8038dff51bddedfd9339b367ebc2d4cd244cd8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page