Home

Awesome

ipyrmd

Convert between IPython/Jupyter notebooks and R Markdown documents

This script provides conversion in both directions between the IPython notebook format (JSON with separate markdown and code) and the R Markdown format (markdown text with annotated code blocks). Conversion to and from plain R files with markdown embedded in knitr-style comments (#' markdown) is also supported.

It only really makes sense to use it with IPython notebooks using the IPython R kernel, but will work with any type of code if you insist.

Conversion should produce useful output, but is not completely lossless:

Usage

python3, nbformat and pyyaml are required.

ipyrmd [--to R|Rmd|ipynb] [--from R|Rmd|ipynb] [-y] [-o outfile] infile

By default the output filename and mode of conversion is determined from the input filename. Notebooks are converted by default to RMarkdown unless you specify R output.

Install

pip3 install [--user] [--upgrade] ipyrmd

Alternatives, it can be installed manually by downloading the archive, extracting it then running python3 setup.py install --user. This should install the ipyrmd script in your local bin directory (probably ~/.local/bin).

TODO

History