Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drillan/jupyter-black
Black formatter for Jupyter Notebook
https://github.com/drillan/jupyter-black
Last synced: about 2 months ago
JSON representation
Black formatter for Jupyter Notebook
- Host: GitHub
- URL: https://github.com/drillan/jupyter-black
- Owner: drillan
- License: bsd-3-clause
- Created: 2018-08-10T05:21:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-01T03:27:05.000Z (almost 5 years ago)
- Last Synced: 2024-08-01T00:47:31.494Z (4 months ago)
- Language: JavaScript
- Size: 126 KB
- Stars: 441
- Watchers: 5
- Forks: 24
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-jupyter-resources - GitHub - 42% open · ⏱️ 01.02.2020): (Jupyter拓展)
- best-of-jupyter - GitHub - 44% open · ⏱️ 01.02.2020): (Jupyter Extensions)
README
# Jupyter Black [Black formatter for Jupyter Notebook]
This extension reformats/prettifies code in a notebook's code cell by [black](https://black.readthedocs.io/en/stable/).
![demo](demo.gif)
**pre-requisites:** of course, you must have some of the corresponding packages installed:
```bash
pip install black [--user]
```Then the extension provides
- a toolbar button
- a keyboard shortcut for reformatting the current code-cell (default: Ctrl-B)
- a keyboard shortcut for reformatting whole code-cells (default: Ctrl-Shift-B)Syntax shall be correct. The extension will also point basic syntax errors.
## Installation
If you use [jupyter-contrib-nbextensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions), proceed as usual.
Otherwise, you can still install/try the extension from personal repo, using
```bash
jupyter nbextension install https://github.com/drillan/jupyter-black/archive/master.zip --user
jupyter nbextension enable jupyter-black-master/jupyter-black
```