Hacker News new | ask | show | jobs
by enriquto 1623 days ago
> Are there any guides on best practices for bridging from notebooks to applications?

The main point of friction is that the "default" format for storing notebooks is not valid, human readable python code, but an unreadable json mess. The situation would be much better if a notebook was stored as a python file, with code cells verbatim, and markdown cells inside python comments with appropriate line breaking. That way, you could run and edit notebooks from outside the browser, and let git track them easily. Ah, what a nice world would that be.

But this is exactly the world we already live in, thanks to jupytext!

https://github.com/mwouts/jupytext

3 comments

There's also org mode in emacs.

https://github.com/nnicandro/emacs-jupyter

I'm not a great fan of notebooks though, I keep using the REPL with X forwarding for matplotlib, sided with a code editor.

Or you could do what I do, and write the report as specially marked comments in the actual code, which can be grepped out later to create a valid markdown document.

Pipe into pandoc, prepend some css, optionally a mathjax header, done. Beautiful reports.

Honestly I've yet to be convinced there's good reason for anything more than this.

Yes, I use a very similar setup with a three-line makefile to test and build. But the OP wanted to use the in-browser notebook interface, and this is srill possible via jupytext (while allowing collaboration with out-of-browser users).