black + nbconvert
Tired of having to think about formatting in Jupyter notebooks? Look no further! This script will correctly format your Jupyter notebooks for you using black.
Warning: This project will overwrite your notebooks in place. It shouldn't change anything except the format, but use at your own risk!
Installation & Usage
To install:
pip install black_nbconvert
To check a notebook:
black_nbconvert --check /path/to/a/notebook.ipynb
To fix the formatting in a notebook (in place):
black_nbconvert /path/to/a/notebook.ipynb
If you pass a directory instead of a notebook file, notebooks will be found recursively below that directory. For example:
black_nbconvert .
will fix the formatting for all notebooks in the current directory and (recursively) below.
Configuration: Configuration for black in a pyproject.toml file above the target files will be respected.
Version control integration
Use pre-commit.
Once you have it installed, add this to the .pre-commit-config.yaml in your repository:
repos:
- repo: https://github.com/dfm/black_nbconvert
rev: v0.3.0
hooks:
- id: black_nbconvert
Then run pre-commit install and you're ready to go.
Metadata
Release files for black-nbconvert 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| black_nbconvert-0.4.0.tar.gz | 7.1 kB | Without provenance | Details for black_nbconvert-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| black_nbconvert-0.4.0-py36-none-any.whl | Python 3.6 | none | any | Details for black_nbconvert-0.4.0-py36-none-any.whl |
Total release size: 11.8 kB
Release files / black_nbconvert-0.4.0.tar.gz
| Download URL | black_nbconvert-0.4.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7beb4a73183a8e182d2d5c96ae924862c70ae4006dba700e15b1d90fb211b4b6
|
|
BLAKE2b-256 checksum How to use checksums |
1feed9ffe39274a8dbd6b2397a29458d88d9d0417696186ac78da46d0aa07668
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
|
Release files / black_nbconvert-0.4.0-py36-none-any.whl
| Download URL | black_nbconvert-0.4.0-py36-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3.6 |
|
SHA-256 checksum How to use checksums |
475befd7c04f6e3cfe859e69a71e0222a6cb730d5f841f87b2435242cafe824f
|
|
BLAKE2b-256 checksum How to use checksums |
bdfe6c7fdb4198bcf4fbff5ca0c18ff102692820d199f329c6a67122b0964103
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
|
Security for black-nbconvert 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.