Skip to main content

jupyter-plainb

Github Actions Status

A JupyterLab extension to convert plaintext files to Jupyter notebooks

Installation

pip install jupyter-plainb

Requirements

  • JupyterLab >= 4.0.0

Usage

1. Convert to Notebook

Select a .py or .md file in the file browser → right-click → Convert to Notebook submenu → pick a parser.

  • If a .ipynb with the same base name already exists, a confirmation dialog asks before overwriting.

2. Open With (Direct notebook editor)

You can open and edit .py or .md files directly in the JupyterLab Notebook editor without generating a .ipynb file.

  • Right-click a .py or .md file in the file browser → hover over Open With → select Notebook.
  • Edits and cell runs save directly back to the original plaintext file format.

3. Convert to Plain Text (Reverse conversion)

Convert an existing .ipynb notebook back to one of the supported plaintext formats.

  • Right-click a .ipynb file → hover over Convert to Plain Text submenu → select a target format.

4. Auto-convert on startup

Add plainTextNotebookConfig to jupyter_config.json (or JupyterLite's jupyter-lite.json):

{
  "jupyter-config-data": {
    "plainTextNotebookConfig": {
      "rules": [
        { "dir": "percent", "parser": "parsePy" },
        { "dir": "sphinx_gallery", "parser": "parseSphinxGallery" },
        { "dir": "markdown", "parser": "parseClassicMd" },
        { "dir": "myst", "parser": "parseMystMd" }
      ]
    }
  }
}

Each rule watches a directory and converts matching files on JupyterLab startup (skips files that already have a .ipynb sibling).

Supported formats

Parser Menu label File type Format
parsePy Percent format (.py) .py Jupytext percent
parseSphinxGallery Sphinx Gallery (.py) .py Sphinx-Gallery
parseClassicMd Classic Markdown (.md) .md Standard markdown — fenced code blocks become code cells
parseMystMd MyST Notebook (.md) .md MyST-NB {code-cell} directives

Uninstall

pip uninstall jupyter-plainb

Contributing

See CONTRIBUTING.md

Release files for jupyter-plainb 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyter-plainb 0.2.3
File Size Uploaded
jupyter_plainb-0.2.3.tar.gz 435.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-plainb 0.2.3
File Interpreter ABI Platform
jupyter_plainb-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 500.3 kB

Release files / jupyter_plainb-0.2.3.tar.gz

Download URL jupyter_plainb-0.2.3.tar.gz
Size 435.6 kB
Tags Source
SHA-256 checksum
How to use checksums
246e548a764ce68d8b4e0c6271a4a90212e1110e5f933cda22aa8ea26a1b0abd
BLAKE2b-256 checksum
How to use checksums
cbbe8f54bc7b5e8d0a583b01917a73d01f68c59ee000be3d0a35a9cab67dc441
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / jupyter_plainb-0.2.3-py3-none-any.whl

Download URL jupyter_plainb-0.2.3-py3-none-any.whl
Size 64.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a137f367ef5731beb774bec087ee0aa35291a6845ca7266ac8ac68731745c91
BLAKE2b-256 checksum
How to use checksums
490cdbea4eadda6f22b23333cb17de4409be56ad8eb15925bff16ae73b4f6b21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page