Convert between Markdown (.md) and Jupyter Notebook (.ipynb) formats
Project description
Jupyter Switch
A powerful, lightweight and intuitive tool to seamlessly convert between Markdown (.md) and Jupyter Notebook (.ipynb) formats.
✨ Features
- 🚀 Automatic detection: Automatically detects whether the input file is
.mdor.ipynband converts accordingly - 🔄 Bidirectional conversion: Convert from Markdown to Jupyter Notebook and vice versa
- 🛡️ Backup protection: Automatically creates backups when output files already exist
- 📋 Preserves structure: Maintains code blocks, markdown content, and cell structure
- 🔧 MCP integration: Works as an MCP server tool for AI assistants
🤖 MCP Tool Usage (Recommended for AI Assistants)
This package provides an MCP (Model Context Protocol) server that can be used with AI assistants like Claude.
Installation as MCP Server
Add to your MCP settings configuration:
{
"mcpServers": {
"jupyter-switch": {
"command": "uvx",
"args": ["--from", "jupyter-switch", "jupyter-switch-mcp"]
}
}
}
Available Tool
switch_file: Converts between.mdand.ipynbformats automatically based on input file extension
Recommended Workflow for .ipynb Editing
- Convert to Markdown: Use the
switch_filetool to convert.ipynb→.mdfor easier editing - Edit: Modify the
.mdfile with your preferred editor - Convert back: Use the tool again to convert
.md→.ipynbwhen done
Example
"Translate this notebook to French, using jupyter-switch"
📦 CLI Usage
Installation
Install the package using pip:
pip install jupyter-switch
Usage
The main command is jupyter-switch:
# Convert a Markdown file to Jupyter Notebook
jupyter-switch example.md
# Convert a Jupyter Notebook to Markdown
jupyter-switch example.ipynb
Install with uv (Recommended) ⚡️
uvx will automatically install the package and run the command.
# Convert README.md to README.ipynb
uvx jupyter-switch README.md
# Convert notebook.ipynb to notebook.md
uvx jupyter-switch notebook.ipynb
The tool will automatically:
- Detect the input file format
- Generate the appropriate output filename
- Create a backup if the output file already exists
- Convert the content while preserving structure
Help 🆘
jupyter-switch --help
jupyter-switch --version
Conversion Details 🔄
Markdown to Jupyter Notebook
- Python code blocks (
python...) become code cells - All other content becomes markdown cells
- Adds appropriate notebook metadata and structure
Jupyter Notebook to Markdown
- Code cells become Python code blocks
- Markdown cells are preserved as-is
- Cell outputs are ignored during conversion
Requirements 🐍
- Python >= 3.10
License 📄
MIT License
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 jupyter_switch-0.1.3.tar.gz.
File metadata
- Download URL: jupyter_switch-0.1.3.tar.gz
- Upload date:
- Size: 35.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98201c3e699a75bd31e7266b4e7f4ca1d61ea66c32f524b17255e9984ed17ec6
|
|
| MD5 |
5b469147ebd2e21f3774ea22b267fe1d
|
|
| BLAKE2b-256 |
3778b964c9d261ed1eb95421ccdeb1bf05a527667faf77c9b253e40967102941
|
Provenance
The following attestation bundles were made for jupyter_switch-0.1.3.tar.gz:
Publisher:
release.yml on zc277584121/jupyter-switch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jupyter_switch-0.1.3.tar.gz -
Subject digest:
98201c3e699a75bd31e7266b4e7f4ca1d61ea66c32f524b17255e9984ed17ec6 - Sigstore transparency entry: 747147308
- Sigstore integration time:
-
Permalink:
zc277584121/jupyter-switch@e52609b5f226ee2f12cdd8622d1275e12f766200 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/zc277584121
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e52609b5f226ee2f12cdd8622d1275e12f766200 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jupyter_switch-0.1.3-py3-none-any.whl.
File metadata
- Download URL: jupyter_switch-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b078b9fd2b681340b6cc7c5eb34ed21c562d993d11a2c926277a2d53c8436d7d
|
|
| MD5 |
c2616315c5785e94d6ca7a0f0d00f900
|
|
| BLAKE2b-256 |
93f60dc23bb30fcea0954d8a58e9117650b47d00029fa45c7f8b8b57856a2325
|
Provenance
The following attestation bundles were made for jupyter_switch-0.1.3-py3-none-any.whl:
Publisher:
release.yml on zc277584121/jupyter-switch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jupyter_switch-0.1.3-py3-none-any.whl -
Subject digest:
b078b9fd2b681340b6cc7c5eb34ed21c562d993d11a2c926277a2d53c8436d7d - Sigstore transparency entry: 747147309
- Sigstore integration time:
-
Permalink:
zc277584121/jupyter-switch@e52609b5f226ee2f12cdd8622d1275e12f766200 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/zc277584121
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e52609b5f226ee2f12cdd8622d1275e12f766200 -
Trigger Event:
push
-
Statement type: