Skip to main content

Jupyter Notebook → reStructuredText Cells

A Python utility for converting Jupyter notebooks into reStructuredText cells and splitting them into smaller snippets.

What is JupyterCell?

JupyterCell is an open-source tool designed to simplify the process of embedding Jupyter Notebook cells into Sphinx websites. With JupyterCell, you can convert your entire notebook into reStructuredText (rST) and automatically split the converted content into smaller, manageable snippets-each containing code cells and their outputs.

This project is built for educators, researchers, and developers who need a more flexible way to include specific code snippets from notebooks in their documentation projects. JupyterCell handles the tedious work of converting and splitting, so you can focus on creating insightful content for your audience.

Getting Started

Prerequisites

  • Python 3.11+

  • Jupyter Notebook or Jupyter Lab

  • Sphinx (for rST-based documentation)

  • Optional: virtual environment (recommended)

To get started with JupyterCell, you’ll need to have Python and the required dependencies installed. Here’s how you can set things up:

Installation

python3 -m venv env
source env/bin/activate    # On Windows, use `env\Scripts\activate`

Now, install the package directly from PyPI:

pip install jupyter-cell

Usage

You can use JupyterCell from the command line with the following syntax:

jupyter-cell --notebook path/to/notebook.ipynb [--prefix <prefix>] [--keep]
  • –notebook (-n) [Required]: The path to the Jupyter notebook you want to convert.

  • –prefix [Optional]: Prefix for the generated snippet files (Default: cell-).

  • –keep [Optional]: Whether to keep the full RST file after splitting into snippets (Default: False).

Example

Suppose you have a Jupyter Notebook called some_notebook.ipynb in your current directory. To convert and split it into smaller rST snippets, run the following command:

jupyter-cell --notebook some_notebook.ipynb --prefix snippet- --keep

This will produce:

  • A full some_notebook.rst file.

  • Several smaller files, each named snippet-1.rst, snippet-2.rst, etc., containing individual cells or cell/output pairs.

The –keep flag ensures that the original some_notebook.rst is preserved.

Contributions

Contributions and/or suggestions are welcome! If you find a bug, have a feature request, or want to contribute improvements, please open an issue or submit a pull request on GitHub.

License

JupyterCell is licensed under the MIT License. See the LICENSE file for more details.

Metadata

Release files for jupyter-cell 2024.9.15

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-cell 2024.9.15
File Size Uploaded Provenance
jupyter_cell-2024.9.15.tar.gz 11.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-cell 2024.9.15
File Interpreter ABI Platform
jupyter_cell-2024.9.15-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / jupyter_cell-2024.9.15.tar.gz

Download URL jupyter_cell-2024.9.15.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
90523f689c4b53a5c17de50637d4e8339f4c2af50a61efdc2ec8238aeaac1616
BLAKE2b-256 checksum
How to use checksums
a28d5d18d6055ed06d500ddc6a4da37e72d436bb90de3afebbfca6c0b6267bdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.1

Release files / jupyter_cell-2024.9.15-py3-none-any.whl

Download URL jupyter_cell-2024.9.15-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3975a5ed9cc54f461715c840eb5d91bc10903059b6b2d7e247ebb078c7c6fa09
BLAKE2b-256 checksum
How to use checksums
d0d6f01186c82d3e6f9aa872fee404b814499b7470dab107be4f4f69e90f1968
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.1

Security for jupyter-cell 2024.9.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

2024.9.15 This release

2 release files No provenance

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