Skip to main content

rst2ipynb

This project provides a way to convert standalone reStructuredText files to Jupyter notebook files.

This is currently achieved by converting to markdown using pandoc and then to a Jupyter notebook using notedown, plus some configuration and tweaks.

Requirements

Python 3 (for proper UTF-8 support in notedown), pandoc, notedown

Installation

Install pandoc and then this module as usual:

git clone https://github.com/nthiery/rst-to-ipynb.git
cd rst-to-ipynb
pip3 install .

pip3 will install the other dependencies as needed.

Caveat: the notedown package on pipy (1.5.0, 2015-10-07) is somewhat outdated; for better conversion, it is recommended to install the latest version from the github repo.

Usage

To convert a reST file xxx.rst to a Jupyter notebook xxx.ipynb, run:

rst2ipynb xxx.rst -o xxx.ipynb

Example

TODO

  • [X] Handle Sage’s doctests

  • [X] Fenced code blocks: fix incompatibility between pandoc output and notedown input.

    Fixed in notedown; see: https://github.com/aaren/notedown/issues/29.

  • [ ] Configurability of the default ReST role, in particular to handle maths in Sage’s ReST dialect.

    Current status: hardcoded for Sage.

  • [ ] Configurability of custom ReST roles, in particular to handle Sage’s custom roles

  • [ ] Proper argument parsing; escape characters, spaces, … are not

    yet supported

  • [ ] Handle input/output blocks within itemize and other indented constructions

    See https://github.com/aaren/notedown/issues/33

Metadata

Release files for rst2ipynb 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 rst2ipynb 0.2.3
File Size Uploaded Provenance
rst2ipynb-0.2.3.tar.gz 6.1 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 13.2 kB

Release files / rst2ipynb-0.2.3.tar.gz

Download URL rst2ipynb-0.2.3.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
30d70b0e96f1c37baad9c8dbe904fc2567354eec02c52b94e7c7287b6268eaa3
BLAKE2b-256 checksum
How to use checksums
5773279784ff0ff3d6fc087bd28d9eb4740d4a8afc95760b72e35fd2edf8eddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL rst2ipynb-0.2.3-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
444f431a33076cfa8f88975c11f34b5b70329856b09811ae5361372ce210b432
BLAKE2b-256 checksum
How to use checksums
ac458b2e692eda075aeb116e440afd4f0d5b3d0ea90d295cc27bb96cba9901b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for rst2ipynb 0.2.3

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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