Skip to main content

Swarmauri Markdown publishing tool for converting Jupyter notebooks into documentation-ready Markdown.

Project description

Swarmauri Logo

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

Swarmauri Jupyter Export Markdown Tool

swarmauri_tool_jupyterexportmarkdown converts a Jupyter notebook dictionary into Markdown using nbconvert.MarkdownExporter, with optional template selection and inline style resources for static publishing workflows.

Why

  • Convert notebooks into documentation-friendly Markdown.
  • Feed notebook output into static-site, docs, and content pipelines.
  • Keep notebook-to-Markdown generation inside a Swarmauri tool interface.

Features

  • Accepts notebook content as a Python dictionary.
  • Normalizes list-based cell sources before export.
  • Exports with nbconvert.MarkdownExporter.
  • Supports optional custom templates.
  • Supports optional style resources for embedded export customization.

FAQ

What kind of input does this tool expect?

It expects a JSON-like Python dictionary representing a notebook, not a raw file path and not a JSON string.

Does it write a .md file?

No. It returns Markdown content in exported_markdown.

What is the styles argument for?

It lets callers pass style content into the nbconvert resources structure for custom Markdown export workflows.

Installation

uv add swarmauri_tool_jupyterexportmarkdown
pip install swarmauri_tool_jupyterexportmarkdown

Usage

from swarmauri_tool_jupyterexportmarkdown import JupyterExportMarkdownTool

notebook = {
    "cells": [
        {"cell_type": "markdown", "metadata": {}, "source": ["# Demo"]},
        {
            "cell_type": "code",
            "metadata": {},
            "execution_count": None,
            "outputs": [],
            "source": ["print('hello')"],
        },
    ],
    "metadata": {},
    "nbformat": 4,
    "nbformat_minor": 5,
}

result = JupyterExportMarkdownTool()(notebook_json=notebook)
print(result["exported_markdown"])

Examples

Export Markdown with a custom template

result = JupyterExportMarkdownTool()(
    notebook_json=notebook,
    template="lab",
)

Export Markdown with custom styles

result = JupyterExportMarkdownTool()(
    notebook_json=notebook,
    styles="pre { font-size: 0.9rem; }",
)

Related Packages

Foundational Swarmauri Packages

More Documentation

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-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupyterexportmarkdown-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 df7a64a4023e8424ebfe4f1ceb125b13f2d7edb7d9cd3f521d2893c60e3ce7e6
MD5 d4222bf23e8989719ea46c874584e6c1
BLAKE2b-256 acf5a3bd57933e110eae20bd1a4f2507afa5325e63068ce53da1859bae64160d

See more details on using hashes here.

File details

Details for the file swarmauri_tool_jupyterexportmarkdown-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_jupyterexportmarkdown-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 7373622e7c9bcd2cfb471c96466a850b7961f6fab51436aeac7fe7e4ffc64864
MD5 a4f7a8843563393fddb3ed73e3fdda7f
BLAKE2b-256 16a41775187c09e5cd09d01fc86320774a043140359b2d24b2e5dcfe34b4dfe8

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