IPython magic command to format python code in cell using black.
Project description
IPython magic command to format python code in cell using black.
What is the magic command?
%%black
Setup
Using pip
pip install blackcellmagic
Directly from the repository
git clone https://github.com/csurfer/blackcellmagic.git
python blackcellmagic/setup.py install
Load Extension in IPython
%load_ext blackcellmagic
Usage
# To have it formatted to black default length 88 with string normalization.
%%black
# To have it formatted to a particular line length.
%%black -l 79
%%black --line-length 79
# To skip string normalization.
%%black -S
%%black --skip-string-normalization
Extras
Tobin Jones has been kind enough to develop a NPM package over blackcellmagic to format all cells at once which can be found here.
Contributing
Bug Reports and Feature Requests
Please use issue tracker for reporting bugs or feature requests.
Development
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blackcellmagic-0.0.3.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for blackcellmagic-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 521a89fd1de8848dace5c570c8db5d326b6731aad34927df7d6038e400a577ea |
|
MD5 | 9b43322bb2a9f4ed22bb6a888a4da20d |
|
BLAKE2b-256 | 761e42813e6619ebed88c59818eb2e4b79ecab7b90fe28a8ba3a208c2245dbb8 |