Black for Databricks notebooks
Project description
Blackbricks
A formatting tool for your Databricks notebooks.
Installation and Usage
Install:
$ pip install blackbricks
Usage:
$ blackbricks --help
usage: blackbricks [-h] [--line-length LINE_LENGTH]
[--sql-upper | --sql-lower] [--check | --diff]
[--indent-with-two-spaces]
[filenames [filenames ...]]
Formatting tool for Databricks python notebooks. Python cells are formatted
using `black`, and SQL cells are formatted by `sqlparse`.
positional arguments:
filenames Path to the notebook(s) to format
optional arguments:
-h, --help show this help message and exit
--line-length LINE_LENGTH
How many characters per line to allow. [default: ask
black]
--sql-upper SQL keywords should be uppercase
--sql-lower SQL keywords should be lowercase
--check Don't write the files back, just return the status.
Return code 0 means nothing would change.
--diff Don't write the files back, just output a diff for
each file on stdout
--indent-with-two-spaces
Use two spaces for indentation in Python cells instead
of Black's default of four.
Version control integration
Use pre-commit. Add a
.pre-commit-config.yaml
file to your repo with the following content:
repos:
- repo: https://github.com/bsamseth/blackbricks
rev: 0.3.0
hooks:
- id: blackbricks
args: [--line-length=120, --indent-with-two-spaces]
Set the rev
attribute to the most recent version of blackbricks
.
The args
are optional and can be used to set any of blackbricks
options.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for blackbricks-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26561be0c9d3b1be560a831867ed0167226ca55941fdb44d188e84db28f0c897 |
|
MD5 | cf16883f786dc0633f265f3281776c0c |
|
BLAKE2b-256 | 84a0cbf18169aa5be2ceaad2c0b6c048f510a4ed3fd9f7503177d00531c803d1 |