Skip to main content

Convert org-mode files to Jupyter Notebooks

Project description

Org to IPYNB

Preamble

It should be remembered that the use of the operating system known as "Emacs" is prohibited by the Geneva Conventions and makes any user liable to a crime against humanity.

Indeed, this ignominy, whose violence and horror remain indescribable to us, is still far too widely used within the Linux community. There are many other tools available, such as ed, vim, nano... How can its use be justified, especially if it is shameless?

We are appalled and dumbfounded by this aberration. It is this service to humanity that has motivated us in this project. It's to save those who suffer from this evil. It is for you. You, who have desperately sought a solution. You, who have been desperate to get out of this trap. You, who represent that flickering glimmer of hope for a better future.

Résiste ! Prouve que tu existes ! Cherche ton bonheur partout, va, refuse ce monde égoïste ! Résiste. Suis ton cœur qui insiste ! Ce monde n'est pas le tien, viens, bats-toi, signe et persiste ! Résiste !

image

Requirements

  • pandoc
  • jupyter notebook
pip3 install jupyter jupyter-c-kernel jupyterlab notebook

then

install_c_kernel --user
  • gcc
    • OpenMP

You can test whether everything works using this command and this :

gcc -fopenmp code_block.c -o codeblock
./code_block
// OpenMP header
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
 
int main(int argc, char* argv[])
{
    int nthreads, tid;
 
    // Begin of parallel region
    #pragma omp parallel private(nthreads, tid)
    {
        // Getting thread number
        tid = omp_get_thread_num();
        printf("Welcome to GFG from thread = %d\n",
               tid);
 
        if (tid == 0) {
 
            // Only master thread does this
            nthreads = omp_get_num_threads();
            printf("Number of threads = %d\n",
                   nthreads);
        }
    }
}

Principle

We take a .org file and convert it to html and a json using pandoc <filename>.org -o out.html and pandoc <filename>.org -o out.json. Then we parse those intermediate renderings to extract the bits of code and generate a usable json IPYNB.

Usage

Usage: jupytorg src=input_file_path (optional type=code_block_language dest=output_file_path)
    input_file_path : the path to input the file
    output_file_path : the path to output the file (default is output_file.ipynb)

Example with a newcourse.org file:

jupytorg src=~/Documents/2A/OpenMP/newcourse.org dest=~/Documents/2A/OpenMP/newcourse.ipynb

It reads the .org file in the specified folder and drops the coonverted jupyter notebook into the same folder. All that remains is to open it with VSCode.

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

jupytorg-0.2.5.tar.gz (546.0 kB view details)

Uploaded Source

Built Distribution

jupytorg-0.2.5-py3-none-any.whl (548.1 kB view details)

Uploaded Python 3

File details

Details for the file jupytorg-0.2.5.tar.gz.

File metadata

  • Download URL: jupytorg-0.2.5.tar.gz
  • Upload date:
  • Size: 546.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.12.1 Linux/6.6.13-200.fc39.x86_64

File hashes

Hashes for jupytorg-0.2.5.tar.gz
Algorithm Hash digest
SHA256 97fa1845e94d8375da62e8ec44b78f2fa67c23bbe3be9d44de5148dc61fb2c5d
MD5 c30d046bcc56de43a29fe2ad868eb3b6
BLAKE2b-256 c8893c233b0bcf704cae74685278c4396f1b250a21ce5e393d7a6f16aa99a197

See more details on using hashes here.

File details

Details for the file jupytorg-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: jupytorg-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 548.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.12.1 Linux/6.6.13-200.fc39.x86_64

File hashes

Hashes for jupytorg-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0e05b3c857cbef8fd38c13b1d7f1af25be601a15364f3bf03d9c4c8570c55a83
MD5 eefe2f00f79064c30effac97666cc7fe
BLAKE2b-256 b0e3b29219b9281f900be67b669d94108f7681b8f30da1bc2c97f94cbd941060

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