2

I would like to use Jupyter/IPython notebooks for writing reports, but I would prefer to avoid the browser interface. Instead, I would like to be able to write the notebook in some text-based format, e.g. markdown, and export the notebook afterwards. Essentially I would like to use Jupyter in a Knitr-esque workflow. Is this currently possible?

Thanks in advance.

wvoq
  • 553
  • 3
  • 13
  • Hi. If you want to write Ipython scripts in IDE try to use the PyCharm. But if you want to convert *.py to *.ipynb please read this http://stackoverflow.com/questions/23303402/cannot-import-py-file-to-ipython-notebook . – Konstantin Purtov Jul 29 '16 at 14:44

5 Answers5

2

Jupytext does exactly this. It lets you edit scripts or markdown and auto-sync to Jupyter Notebooks and other formats.

Ista
  • 10,139
  • 2
  • 37
  • 38
1

To get a Knitr-esque flow you might look into the Atom plugin, hydrogen. From what I understand it allows you to execute code inline using your installed Jupyter kernels. Of course, this would only work in Atom.

Joshua Cook
  • 12,495
  • 2
  • 35
  • 31
1

You can write reports in Markdown and then convert them into Jupyter notebooks with notedown:

That's the closest option to knitr. It also supports r-markdown (.Rmd) conversion.

Anton Tarasenko
  • 8,099
  • 11
  • 66
  • 91
0

Jupyter Notebooks are stored as json. If you are comfortable reading the raw JSON, simply open the notebook file in your favorite text editor.

Joshua Cook
  • 12,495
  • 2
  • 35
  • 31
0

You mentioned knitr, so at least some of your code is probably R. If so, take a look at the RStudio notebooks preview at http://rmarkdown.rstudio.com/r_notebooks.html. It stores the notebook in plain text as an Rmd file, but expands it to HTML for display. You can also recover the plain text from the HTML. I don't know how good the Python support would be, though.

user2554330
  • 37,248
  • 4
  • 43
  • 90