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
.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
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
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaa47fde0753b9adc820af1325d8c3625175ee0ed006855678cf900c3b910d3a
|
|
| MD5 |
b17c90540f57c0dff86e16c91fefe911
|
|
| BLAKE2b-256 |
90d5b1779ef0fa563306fe214639364db0821f9612683b2c7c1bc6c97adeab3f
|
Provenance
The following attestation bundles were made for jupyter_switch-0.1.1.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.1.tar.gz -
Subject digest:
eaa47fde0753b9adc820af1325d8c3625175ee0ed006855678cf900c3b910d3a - Sigstore transparency entry: 228388833
- Sigstore integration time:
-
Permalink:
zc277584121/jupyter-switch@905f1fd0a88d49fe5c24bf1cb9af96ca6e876384 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/zc277584121
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@905f1fd0a88d49fe5c24bf1cb9af96ca6e876384 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a50abd942817f1a719c11d96ba6a97fd5651a62ef4c919dca912194e3620711
|
|
| MD5 |
8752c5a350acfe466716a9a1eddd9bf4
|
|
| BLAKE2b-256 |
53aabdab613bd0c82c02fd020a6ff9c76ef555e51f567957f7acef0e7f9b6c90
|
Provenance
The following attestation bundles were made for jupyter_switch-0.1.1-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.1-py3-none-any.whl -
Subject digest:
0a50abd942817f1a719c11d96ba6a97fd5651a62ef4c919dca912194e3620711 - Sigstore transparency entry: 228388838
- Sigstore integration time:
-
Permalink:
zc277584121/jupyter-switch@905f1fd0a88d49fe5c24bf1cb9af96ca6e876384 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/zc277584121
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@905f1fd0a88d49fe5c24bf1cb9af96ca6e876384 -
Trigger Event:
push
-
Statement type: