3

I'm starting to work more with Jupyter notebooks, and am really starting to like it. However, I find it difficult to use it with my particular setup.

I have a workstation for running all the notebooks, but for a large part of my day I'm on-the-go with a space-constrained laptop with no power outlets. I'd like to be able to edit (but not run) these notebooks without installing and running the full Jupyter server backend, which I imagine would suck up a lot of power.

My question is: Is it possible for me to edit (and not run) notebooks without running the Jupyter server?

Jeeter
  • 5,887
  • 6
  • 44
  • 67
  • What are the specs on your laptop? The `jupyter` server isn't any more demanding on memory than `ipython` console mode. I use a refurbished business desktop. – hpaulj Jan 13 '20 at 16:22

2 Answers2

5

You could use one of the following options

1. ipynb-py-convert

With this module you can do a conversion from .py to .ipynb and vice-versa:

ipynb-py-convert ~/name_of_notebook.ipynb ~/name_of_notebook.py

where according to the documentation the cells are left as they are. To get back a jupyter notebook

ipynb-py-convert ~/name_of_notebook.py ~/name_of_notebook.ipynb

2. Ipython

However, you could also do a conversion to .py when you want to work it with an editor like VS Code or Sublime Text after you have download your .ipynb file with ipython:

ipython nbconvert --to python name_of_your_notebook.ipynb
Miguel Trejo
  • 5,913
  • 5
  • 24
  • 49
  • Jupytext can do similar conversions from notebook to script and back again, see [here](https://stackoverflow.com/a/53387906/8508004). – Wayne Jan 10 '20 at 18:32
1

As I was asking this question, I had opened the notebook locally in Visual Studio Code, but the preview was just the raw text representation of the notebook, so I had assumed that it needed the backend to run.

However, I was about to press submit on the question when I checked back in on it, and the notebook showed up just fine. So one solution is to open it in VS Code and wait a little bit.

Jeeter
  • 5,887
  • 6
  • 44
  • 67