Skip to main content

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

Project description

Jupyter Switch

A command-line tool to 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

Installation

Install the package using pip:

pip install .

Or for development:

pip install -e .

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

Examples

# Convert README.md to README.ipynb
jupyter-switch README.md

# Convert notebook.ipynb to notebook.md
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.1.tar.gz (4.3 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.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyter_switch-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 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.1.tar.gz
Algorithm Hash digest
SHA256 eaa47fde0753b9adc820af1325d8c3625175ee0ed006855678cf900c3b910d3a
MD5 b17c90540f57c0dff86e16c91fefe911
BLAKE2b-256 90d5b1779ef0fa563306fe214639364db0821f9612683b2c7c1bc6c97adeab3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_switch-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: jupyter_switch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a50abd942817f1a719c11d96ba6a97fd5651a62ef4c919dca912194e3620711
MD5 8752c5a350acfe466716a9a1eddd9bf4
BLAKE2b-256 53aabdab613bd0c82c02fd020a6ff9c76ef555e51f567957f7acef0e7f9b6c90

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_switch-0.1.1-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