Emacs minor mode for generating and interacting with jupyter notebooks
Project description
Emacs minor mode for generating and interacting with jupyter notebooks.
Quick Start
pynt is available for download through MELPA. Once you have configured emacs to use MELPA then run the following commands in emacs.
M-x package-install RET pynt C-x C-f my-python-file.py M-x pynt-mode
Feature List
On-the-fly notebook creation
Simply start pynt-mode on a python file and a new notebook will be created for you to interact with (provided you have set the variable pynt-start-jupyter-server-on-startup to t)
Dump a region of python code into a jupyter notebook
Selectable regions include functions, methods, and code at the module level (i.e. outside of any function or class)
Scroll the resulting jupyter notebook with the code buffer
Alignment between code and cells are preserved even when cells are added and deleted
Generate web-browser-based jupyter notebooks
Using pynt
Once you have opened a python file and pynt-mode is active you should select the region of code you would like to dump into a jupyter notebook by typing C-c C-s and cycling though the resulting code regions. Once you have made a selection hit C-c C-e to dump that code region into a jupyter notebook.
It is recommended at this point to enable pynt-scroll-mode which scrolls (i.e. aligns) the notebook cells with the code lines. You can activate pynt-scroll-mode with M-x pynt-scroll-mode RET.
EIN Tweaks
There are a few tweaks to EIN that make the pynt/EIN experience nicer IMO.
Have C-<return> and S-<return> behave as they would in a jupyter web browser client
Arrow through the worksheets in a EIN notebook buffer (warning: evil-specific)
Prevent jupyter from popping open a new tab in your web browser on startup
Screenshots
Jupyter Notebook Web Browser Client
Emacs IPython Notebook Client
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.