: ![badge](https://github.com/Anoncheg1/j2o/actions/workflows/python-test.yml/badge.svg?event=push)
: ![badge](https://github.com/Anoncheg1/j2o/actions/workflows/python-publish.yml/badge.svg?event=release)
* j2o
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.

https://pypi.org/project/j2o/

* Command line usage
#+begin_src text
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.
#+end_src
For Linux add this line to ~~/.bashrc~
#+begin_src sh
export PATH=$PATH:/home/youruser/.local/bin
#+end_src
* How this works
1) Loops through "cells".
2) Extract "source"
3) add Org header and tail around source ("#+begin_src python ...", "#+end_src")

* Info: Other useful projects
- p2j https://pypi.org/project/p2j/ https://github.com/remykarem/python2jupyter
- https://github.com/jkitchin/ox-ipynb
* Info: Format of ipynb
JSON
#+begin_src 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"
    }
  }
}
#+end_src

* features
- in markdown cells conversion: source blocks, ‘#’ to ‘*’.
- code cells: images
- Tested for nbformat: 4.2.
