Skip to main content

Converter from Jupyter notebook format to Org format (Emacs text editor), without requirements for any libraries.

Project description

Table of Contents

  1. j2o

  2. Command line usage

  3. How this works

  4. Info: Other useful projects

  5. Info: Format of ipynb

  6. features

    badge badge

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

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.

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

Info: Format of 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"
    }
  }
}

features

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

j2o-0.0.6.tar.gz (622.8 kB view details)

Uploaded Source

Built Distribution

j2o-0.0.6-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file j2o-0.0.6.tar.gz.

File metadata

  • Download URL: j2o-0.0.6.tar.gz
  • Upload date:
  • Size: 622.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for j2o-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d1c135c73616ceb17d5be2eaa7f71daadf9e0a41681b090b0a2224a43b0a0797
MD5 42ee29e3906fab5e363056efd1bfb9c5
BLAKE2b-256 02e1b7ad1ecacf15c61e9a1755a6072d93da7775d4b4600826d7f3a1d56113f7

See more details on using hashes here.

File details

Details for the file j2o-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: j2o-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for j2o-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 64f817f5659e3eb9476db27f9de2254460a09196db4c1d1cc1d2f5fbe1c5126d
MD5 e4802cc38aa46c860af6b4686bb1f953
BLAKE2b-256 fdd1583a00b75c8e4f5c388e7378fd441dcc29fd45c5b328d3690ab09109f1bd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page