Skip to main content

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.

Files for blackcellmagic, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size blackcellmagic-0.0.2.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page