Skip to main content

Convert between Markdown (.md) and Jupyter Notebook (.ipynb) formats

Project description

Jupyter Switch

PyPI version License: MIT

A powerful, lightweight and intuitive command-line tool to seamlessly convert between Markdown (.md) and Jupyter Notebook (.ipynb) formats.

✨ Features

  • 🚀 Automatic detection: Automatically detects whether the input file is .md or .ipynb and 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

Install & Usage from PyPI

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 & Usage from 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter_switch-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

jupyter_switch-0.1.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_switch-0.1.2.tar.gz.

File metadata

  • Download URL: jupyter_switch-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jupyter_switch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2c40efa019de800d3be396107496aaf2b720d8980f394302f8b4feb445c41689
MD5 66841fb34e6e16f093b5d3d2862272cd
BLAKE2b-256 1e90429288b2f3abafb02f7591e432794c9ee3d833276241439b7ad3cd4fa19f

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_switch-0.1.2.tar.gz:

Publisher: release.yml on zc277584121/jupyter-switch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jupyter_switch-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: jupyter_switch-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jupyter_switch-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 706d90f4d3d77e4f2f385767d8a5573f9cce26855ca04500e939ebe9d38dd1df
MD5 20b318a0b7a32c8b5e5ca877110721a3
BLAKE2b-256 59b89d2e6a31a1cf7df477a5dbdc98dd4b42ccf992cfe2968deabfa9b5bff74b

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_switch-0.1.2-py3-none-any.whl:

Publisher: release.yml on zc277584121/jupyter-switch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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