Need help with blackcellmagic?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

246 Stars 8 Forks MIT License 16 Commits 5 Opened issues


IPython magic command to format python code in cell using black.

Services available


Need anything else?

Contributors list


pypiv pyv Licence Thanks

IPython magic command to format python code in cell using black.


What is the magic command?



Using pip

pip install blackcellmagic

Directly from the repository

git clone
python blackcellmagic/ install

Load Extension in IPython

%load_ext blackcellmagic


# To have it formatted to black default length 88.

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.

Buy the developer a cup of coffee!

If you found the utility helpful you can buy me a cup of coffee using


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.