Converter from Jupyter to Org file format without any dependencies.
Without this package your only alternative is to use nbconver or pandoc with 164 dependencies just to be able to convert simple JSON format.
TODO: make reverse convrter.
usage: j2o myfile.ipynb [-w] [-j myfile.ipynb] [-o myfile.org]
Convert a Jupyter notebook to Org file (Emacs) and vice versa
positional arguments:
jupfile_ Jupyter file
options:
-h, --help show this help message and exit
-j JUPFILE, --jupfile JUPFILE
Jupyter file
-o ORGFILE, --orgfile ORGFILE
Target filename of Org file. If not specified, it will
use the filename of the Jupyter file and append .ipynb
-w, --overwrite Flag whether to overwrite existing target file.
For Linux add this line to ~/.bashrc
export PATH=$PATH:/home/youruser/.local/bin
- Loops through "cells".
- Extract "source"
- add Org header and tail around source ("#+begin_src python …", "#+end_src")
- p2j https://pypi.org/project/p2j/ https://github.com/remykarem/python2jupyter
- https://github.com/jkitchin/ox-ipynb
JSON
{
cells: [
cell_type: "code/markdown",
source: ["\n","\n",""],
outputs: [{
text: ["\n", "\n"],
data: {
image/png: "base64....",
text/plain: "image description"}
}
]
],
metadata: {
kernelspec: {
language: "python"
}
}
}
- in markdown cells conversion: source blocks, ‘#’ to ‘*’.
- code cells: images
- Tested for nbformat: 4.2.