Format Python code blocks in Quarto Markdown (.qmd) files using Black
Project description
qmdblack
Format Python code blocks in Quarto Markdown (.qmd) files using Black.
Quarto cell option directives (#| lines) are preserved as-is at the top of each block.
Installation
pip install qmdblack
Usage
# Format files in-place
qmdblack notebook.qmd
# Check without writing (exit 1 if any file would change)
qmdblack --check notebook.qmd
# Show a diff without writing
qmdblack --diff notebook.qmd
# Custom line length (default: 88)
qmdblack -l 100 notebook.qmd
# Multiple files
qmdblack *.qmd
Example
Before:
```{python}
#| echo: false
x=1+2
y = x*3
print( y )
```
After:
```{python}
#| echo: false
x = 1 + 2
y = x * 3
print(y)
```
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qmdblack-0.2.0.tar.gz.
File metadata
- Download URL: qmdblack-0.2.0.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d55327b66960273b2e9746d2c07a4d2f3a67ae4ae2e6fb7fefb2cca7dfd4f74a
|
|
| MD5 |
ee2db56679f2f787b6931109ccfb9699
|
|
| BLAKE2b-256 |
4c3af0c2894dd80ccede52f302248bbd1cbd5ed0a1df764645d4da9e3e1b29ee
|
Provenance
The following attestation bundles were made for qmdblack-0.2.0.tar.gz:
Publisher:
publish.yml on askblaker/qmdblack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qmdblack-0.2.0.tar.gz -
Subject digest:
d55327b66960273b2e9746d2c07a4d2f3a67ae4ae2e6fb7fefb2cca7dfd4f74a - Sigstore transparency entry: 1391582880
- Sigstore integration time:
-
Permalink:
askblaker/qmdblack@e4ec330168b296d85045eb2325229514c9790064 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/askblaker
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e4ec330168b296d85045eb2325229514c9790064 -
Trigger Event:
push
-
Statement type:
File details
Details for the file qmdblack-0.2.0-py3-none-any.whl.
File metadata
- Download URL: qmdblack-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d97389659935b4e40f4834bc5c4dd137c1c7e517a9a7e27b2e9cbce9c1f0565
|
|
| MD5 |
f89fdc2f0d323962bc2adbcefa1ad4aa
|
|
| BLAKE2b-256 |
8d90e4bb35f5df997e85b57c26a7fc2e242e35e542c654176ad612daff12e27f
|
Provenance
The following attestation bundles were made for qmdblack-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on askblaker/qmdblack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qmdblack-0.2.0-py3-none-any.whl -
Subject digest:
9d97389659935b4e40f4834bc5c4dd137c1c7e517a9a7e27b2e9cbce9c1f0565 - Sigstore transparency entry: 1391582893
- Sigstore integration time:
-
Permalink:
askblaker/qmdblack@e4ec330168b296d85045eb2325229514c9790064 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/askblaker
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e4ec330168b296d85045eb2325229514c9790064 -
Trigger Event:
push
-
Statement type: