Keep python and notebook automatically in sync
See original GitHub issueFeature: Notebook Editor, Interactive Window, Python Editor cells
Description
The notebook provides an option ‘Convert and save to a Python script’, which creates a representation of the notebook as a standard .py
script using the ‘percent format’. This does not only provide yet another way to interactively work with Python and rich output – the format is also a solution to the long-standing problem that the JSON-format of .ipynb
files including embedded binary data (graphics) does not play well with source control systems.
Personally I prefer to work with the standard notebook editor interface, but because of the latter problem with source control I like to have a percent-formatted version in parallel.
My feature request: Have an option, either global, per-workspace, or per-notebook, that whenever an .ipynb
file is saved, a percent-formatted version of it is created/updated in the background, too. This way the notebook proper can be used for interactive work, but the commits on the percent-formatted version can serve as a readable record of what was done, so if it is necessary to revert changes, it is clear which commit is the right one.
Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl
Issue Analytics
- State:
- Created 3 years ago
- Reactions:38
- Comments:16 (7 by maintainers)
Top GitHub Comments
@venaturum I’ve created an extension that does this (open a Python file and execute as a notebook) today https://github.com/notebookPowerTools/vscode-jupytext Currently only usable in VS Code Insiders.
Definitely agree with this. Now that we have the real jupyter feel directly inside of VSCode, we don’t even need to open a browser anymore. The problem is that when VSCode reads percent scripts, the look and feel of the interactive mode is different (and worse) than the new functionality.
We use percent scripts in the repo and open them using Jupyter with Jupytext. Jupytext links the percent script with the ipynb file, just as @allefeld is explaining. It’d be perfect to have this functionality right inside the editor.