Helium icon indicating copy to clipboard operation
Helium copied to clipboard

Import from .ipynb file

Open pykong opened this issue 5 years ago • 2 comments

Conversion functionality to allow importing/exporting with .ipynb files may be considered. Some libraries to consider:

  • https://github.com/elehcimd/pynb
  • https://github.com/jupyter/nbconvert

pykong avatar Feb 13 '20 19:02 pykong

I could use a similar functionality as well. If there aren't plans on solving this, I could look into it. I have some ideas on how to solve this.

I would do it like this:

  • add unique keys to the metadata of the notebook, i.e. "cell_id": cell_id. This allows us the pair each cell in the notebook with a cell in the helium script.
  • Create a file with cells, where each cell is identified by the cell_id, i.e.
# <cell_id>
def do_something():
    pass
  • Upon saving write the code in each (Helium) cell to the respective cell in the original notebook.

What do you think?

cgahr avatar Mar 22 '21 13:03 cgahr

We could use JupyText. I'm already using it to convert .ipynb to .py and it works quite well.

cgahr avatar May 28 '21 10:05 cgahr