IPython wrapper to format cell using black.
IPython magic command to format python code in cell using black.
What is the magic command?
pip install blackcellmagic
Directly from the repository
git clone https://github.com/csurfer/blackcellmagic.git python blackcellmagic/setup.py install
Load Extension in IPython
# To have it formatted to black default length 88. %%black # To have it formatted to a particular line length. %%black -l 79 %%black --line_length 79
Tobin Jones has been kind enough to develop a NPM package over blackcellmagic to format all cells at once which can be found here.
Bug Reports and Feature Requests
Please use issue tracker for reporting bugs or feature requests.
Pull requests are most welcome.