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 details)
Built Distribution
File details
Details for the file blackcellmagic-0.0.3.tar.gz
.
File metadata
- Download URL: blackcellmagic-0.0.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.8.10 Linux/5.11.0-25-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8d42fb462d0fd6ebdb1a9fec825f40493ceb84348d052daf14765689008a665 |
|
MD5 | a39dbca1e1ba365651da7ad0f0fbe354 |
|
BLAKE2b-256 | dd74fa04dad5312b2f401f18710a4f19dd85bfd0e040e8082d646aef0f208cbd |
File details
Details for the file blackcellmagic-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: blackcellmagic-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.8.10 Linux/5.11.0-25-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 521a89fd1de8848dace5c570c8db5d326b6731aad34927df7d6038e400a577ea |
|
MD5 | 9b43322bb2a9f4ed22bb6a888a4da20d |
|
BLAKE2b-256 | 761e42813e6619ebed88c59818eb2e4b79ecab7b90fe28a8ba3a208c2245dbb8 |