Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

IPython wrapper to format cell using black.

Project description

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


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
blackcellmagic-0.0.2.tar.gz (3.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page