Live data from Hacker News

Jupytext: Jupyter notebooks as Python scripts

github.com

11–20 of 42 posts

Re: Jupytext: Jupyter notebooks as Python scripts

#11

This seems neat, but also a bit strange. Are Jupyter notebooks so prevalent that it makes sense to ghave an exporter that makes them into markdown and back again? I mean, I always thought this workflow was neat, but isn't one of the selling points of jupyter the WYSIWYG Interface? And if you like working in code, would it not be easier to create a markdown extension for embedded code (Or does something like this alre…

1 thing. Code review. Even thou notebooks are not meant for production code, it's good to check them into repository to document what you did (let's ignore out of order computation and other horrors), and get feedback on your code / experiment.

Right now, ipython notebook is stored as json, where code is list of json strings (so that you have it line by line).

Additionally, the "WYSIWYG Interface" is horrible in comparison to vim, emacs, idea, pycharm or whatever you are using. What I like about notebooks is being able to present things as experiment: this is the code, and there are the outputs. "WYSIWYG Interface" is good if you want to tweak few things, or if you are starting out.

Re: Jupytext: Jupyter notebooks as Python scripts

#12
post #4

Could this be the answer to "I don't like notebooks" [0]? Or does calling scripts from within a notebook still do horrible things to the managed state? [0] https://news.ycombinator.com/item?id=17856700

I think this partially matches the parts of the criticism about writing a book, and how the notebook is unsuitable - mainly thinking along similar lines to writing software tutorials pages that are fully testable.

After seeing that post I had a look around for something a little like this and found Pweave http://mpastell.com/pweave/ which seems to approach the problem from the inverse direction direction, but I think I'd rather have something like this where the code is marked up and runnable as normal code but transformable into formatted documentation.

This seems like a reasonable match, but it looks like it's explicitly tied to notebooks and I'm not completely sold on the overloading of plain comments for markup purposes. Still, probably a good step.

Re: Jupytext: Jupyter notebooks as Python scripts

#14

This seems neat, but also a bit strange. Are Jupyter notebooks so prevalent that it makes sense to ghave an exporter that makes them into markdown and back again? I mean, I always thought this workflow was neat, but isn't one of the selling points of jupyter the WYSIWYG Interface? And if you like working in code, would it not be easier to create a markdown extension for embedded code (Or does something like this alre…

> So where is my markdown with embedded code WYSIWYG editor that saves into plain text files? ;-)

It's here: https://github.com/gregsexton/ob-ipython

Re: Jupytext: Jupyter notebooks as Python scripts

#15

This is really cool stuff. Editing notebooks in the browser is pretty good, but it can't (yet) match the experience of a well configured (and extended) text editor.

I've been using vscode with the jupyter extension (https://github.com/DonJayamanne/vscodeJupyter) and it's exactly what you describe, experience of a good text editor and the visual notebook workflow.

Re: Jupytext: Jupyter notebooks as Python scripts

#17
post #13
post #5

This is fantastic! Now, they just need to adapt jupyter itself so that it reads the python files directly, dispensing with the need of the silly ipynb!

I think that’s called IPython. But I agree with your sentiment.

I was not being ironic. Notebooks are lovely as an output format for showing your research and allowing others to fiddle with your code. However, for people who do not want to edit inside a web browser window, jupytext is a godsend!

Re: Jupytext: Jupyter notebooks as Python scripts

#18
post #11

This seems neat, but also a bit strange. Are Jupyter notebooks so prevalent that it makes sense to ghave an exporter that makes them into markdown and back again? I mean, I always thought this workflow was neat, but isn't one of the selling points of jupyter the WYSIWYG Interface? And if you like working in code, would it not be easier to create a markdown extension for embedded code (Or does something like this alre…

1 thing. Code review. Even thou notebooks are not meant for production code, it's good to check them into repository to document what you did (let's ignore out of order computation and other horrors), and get feedback on your code / experiment. Right now, ipython notebook is stored as json, where code is list of json strings (so that you have it line by line). Additionally, the "WYSIWYG Interface" is horrible in comp…

I think you misunderstood me. My question was not why you would use an external editor (and get all the benefits you provided), but rather, why work back from jupyter to achieve this rather than working forward from simple markdown and allow code blocks to be embedded and run from the editor.

But maybe I am missing some other features than the interface that the ipython kernel provides? I haven't used it much myself, since I found the setup and usage rather complicated, though to be fair, I don't really use python and its ecosystem much.

Re: Jupytext: Jupyter notebooks as Python scripts

#19
post #14

This seems neat, but also a bit strange. Are Jupyter notebooks so prevalent that it makes sense to ghave an exporter that makes them into markdown and back again? I mean, I always thought this workflow was neat, but isn't one of the selling points of jupyter the WYSIWYG Interface? And if you like working in code, would it not be easier to create a markdown extension for embedded code (Or does something like this alre…

> So where is my markdown with embedded code WYSIWYG editor that saves into plain text files? ;-) It's here: https://github.com/gregsexton/ob-ipython

Well, yeah. Org mode can do anything, right? If only it wasn't so tightly coupled to emacs. Not a hater btw, I just can't get used to the editor. The concept of an extendable editor sounds really good, but it just seems so complicated and uncomfortable to use...

Re: Jupytext: Jupyter notebooks as Python scripts

#20
post #15

This is really cool stuff. Editing notebooks in the browser is pretty good, but it can't (yet) match the experience of a well configured (and extended) text editor.

I've been using vscode with the jupyter extension ( https://github.com/DonJayamanne/vscodeJupyter ) and it's exactly what you describe, experience of a good text editor and the visual notebook workflow.

While working on udacity classes, I found vscode python jupyter plugin very helpful. Having a nice editor makes you so much more productive.

I wrote a little python pip module to help me convert between .ipynb and .py.

https://github.com/nojvek/vscode-ipynb-py-converter

Made a world of difference.

Post reply on HN