<story><title>Nbterm: Jupyter Notebooks in the Terminal</title><url>https://blog.jupyter.org/nbterm-jupyter-notebooks-in-the-terminal-6a2b55d08b70</url></story><parent_chain><item><author>kenward</author><text>Slightly tangent, but has anyone figured out a good solution for version controlling jupyter notebooks?&lt;p&gt;The closest thing that we&amp;#x27;ve found has been to use the notebook percent format in a simple .py file [0][1]. It plays with git much nicer than an .ipynb and it is still interactive enough for rapid prototyping. However, it would be nice to have some first-class support from Jupyter on this.&lt;p&gt;[0] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jupytext.readthedocs.io&amp;#x2F;en&amp;#x2F;latest&amp;#x2F;formats.html?highlight=cell%20syntax#the-percent-format&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jupytext.readthedocs.io&amp;#x2F;en&amp;#x2F;latest&amp;#x2F;formats.html?highl...&lt;/a&gt;&lt;p&gt;[1] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;code.visualstudio.com&amp;#x2F;docs&amp;#x2F;python&amp;#x2F;jupyter-support-py&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;code.visualstudio.com&amp;#x2F;docs&amp;#x2F;python&amp;#x2F;jupyter-support-py&lt;/a&gt;</text></item></parent_chain><comment><author>goodside</author><text>Until recently, I also thought this was a major problem. My old solution was to always pair .ipynb files with proper .py modules of the same name, so the .ipynb always starts with `%run foo.py` and just calls functions.&lt;p&gt;However, I recently started using VSCode Insiders the preview release of VSCode, which has amazing support for Jupyter notebooks in the editor. You can use your normally configured linters, auto-formatters, vi-mode keyboard shortcuts (major selling point for me). You even get legible, cell-aware diffs when comparing in git. Now, the edit&amp;#x2F;git workflow for .ipynb files is so close to parity I&amp;#x27;ve stopped caring whether code is in a proper Python module or not, and I almost never run Jupyter Notebook or Jupyter Lab in the browser.&lt;p&gt;In some ways this is a loss, because it&amp;#x27;s nice to have project-wide linting and other tooling that only work with .py files, but using `%run` was always an imperfect abstraction. By default, `%run` executes modules in a new module namespace which is then copied over, so it&amp;#x27;s not exactly &amp;quot;paste into Jupyter&amp;quot; unless you do `%run -i`. Even then, it&amp;#x27;s limited by running all at once. Every cell in a typical Notebook is effectively a button that runs an `exec()` statement, and you can&amp;#x27;t achieve those semantics by calling Python functions.</text></comment>
<story><title>Nbterm: Jupyter Notebooks in the Terminal</title><url>https://blog.jupyter.org/nbterm-jupyter-notebooks-in-the-terminal-6a2b55d08b70</url></story><parent_chain><item><author>kenward</author><text>Slightly tangent, but has anyone figured out a good solution for version controlling jupyter notebooks?&lt;p&gt;The closest thing that we&amp;#x27;ve found has been to use the notebook percent format in a simple .py file [0][1]. It plays with git much nicer than an .ipynb and it is still interactive enough for rapid prototyping. However, it would be nice to have some first-class support from Jupyter on this.&lt;p&gt;[0] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jupytext.readthedocs.io&amp;#x2F;en&amp;#x2F;latest&amp;#x2F;formats.html?highlight=cell%20syntax#the-percent-format&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jupytext.readthedocs.io&amp;#x2F;en&amp;#x2F;latest&amp;#x2F;formats.html?highl...&lt;/a&gt;&lt;p&gt;[1] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;code.visualstudio.com&amp;#x2F;docs&amp;#x2F;python&amp;#x2F;jupyter-support-py&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;code.visualstudio.com&amp;#x2F;docs&amp;#x2F;python&amp;#x2F;jupyter-support-py&lt;/a&gt;</text></item></parent_chain><comment><author>e3bc54b2</author><text>Forgive the snark because my suggestion is obviously not an improvement or even a match for target audience, but org-mode files with inline org-babel code-blocks is what I consider to be perfect version controlled notebook.&lt;p&gt;Pity Emacs is not the best on-boarding experience.</text></comment>