6 ms·
I love working with notebooks but hate the .ipynb file format with the burning passion of a thousand suns. For those of you who are similarly affected, you may
by enriquto 4y ago
I love working with notebooks but hate the .ipynb file format with the burning passion of a thousand suns.
For those of you who are similarly affected, you may want to try jupytext. It is a tiny package that converts threeway between ipynb, plain python files (whose comment blocks are interpreted as markdown cells) and plain markdown files (whose code blocks are interpreted as code cells). Moreover, if you have jupytext installed, then jupyter will read and write python and markdown files transparently as notebooks so that you don't need to deal with the stupid ipynb files anymore. This is nice because then you can track the evolution of notebooks easily in git, and your local graybeards can edit notebooks with a plain text editor, with no need of a web browser at all.
Of course, the output cells are not saved, but this was always in bad taste anyway. If you want a nice html with the cell outputs you can run "jupyter nbconvert --execute --to html" from the command line (and yes, it will work with plain python or markdown files if you have jupytext installed).
Why this is not part of jupyter proper is beyond me.
EDIT: regarding nbdev, I would like to learn what are the advantages with respect to the minuscule jupytext thing. I'm particularly concerned by the soundness of the quarto dependency, which is a scary behemoth made by accretion of haskell and javascript.
- ahurmazda 4y ago+100 The fact that everyone I talk to agrees that this format sucks and then turns around and ask us to use yet another formatting tool (jupytext, nvcovert blah blah) is equally vexing. Rmarkdown (+rstudio) has shown that one can have the cake and eat it too. Ironically, I prefer rstudio for doing exploratory coding with python. Hopefully their recent pivot to more-than-byond-R will save us from this .ipynb mess.
- enriquto 4y ago> [...] ask us to use yet another formatting tool (jupytext [...] Heh. Notice that jupytext is not merely a file format converter. It is a plugin to jupyter that allows it to treat python and markdown files as notebooks. This works both for input and output, with transparent and idempotent round-trips. Once you have this plugin you don't see ipynb files ever again (unless for some bizarre reason you specifically save your notebooks into this format).
- wodenokoto 4y agoWith the announcement of RStudio (the company) changing name I learned about the existence of qmd, which is sort of the next generation rmd. It’s language agnostic (both in name but also cell meta data is yaml instead of r code) and the ecosystem around it already supports a lot of editors. In defense of ipynb, I really do enjoy that code and output are together. The only place it isn’t nice is in git.
- mwexler 4y agoI hadn't seen the name change yet. Becoming to "Posit", see https://posit.co https://posit.co where they share their vision for their new future.
- nojito 4y agoThat’s the entire point of quarto. https://quarto.org/ https://quarto.org/
- bobbylarrybobby 4y agoRecently played around with Quarto in VSCode the other day and was surprised at how nice it is for a (seemingly) immature product.
- kleingeld 4y agoHow does one use Quarto in VSCode?
- bobbylarrybobby 4y agoThey have an extension that watches a qmd file for changes and regenerates the preview, while also integrating with the language-specific extensions so that you can continue to get intellisense, run code cells, etc despite the file's language being Quarto and not (say) Python.
- Mochsner 4y agoTy for enlightening a jupyter novice (who never understood why people use them, given git garbage), on how to actually use notebooks with a team. Ive been manually moving everything between notebooks and other files