Jupyter autopep8 [PEP8 formatter for Jupyter Notebook]
pre-requisites: of course, you must have some of the corresponding packages installed:
pip install autopep8 [--user]
Then the extension provides
- a toolbar button
- a keyboard shortcut for reformatting the current code-cell (default: Ctrl-L)
Syntax shall be correct. The extension will also point basic syntax errors.
If you use jupyter-contrib-nbextensions, proceed as usual.
Otherwise, you can still install/try the extension from personal repo, using
jupyter nbextension install https://github.com/kenkoooo/jupyter-autopep8/archive/master.zip --user jupyter nbextension enable jupyter-autopep8-master/jupyter-autopep8