Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qmdblack-0.1.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qmdblack-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file qmdblack-0.1.0.tar.gz.

File metadata

  • Download URL: qmdblack-0.1.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qmdblack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f0ea2b57f342872e797f67c6cb1d861f84c313c550d74bbedc74f33a68b8130
MD5 7d3e240a7e2892c8a399fc8c16826202
BLAKE2b-256 be404a92e9a24a92b533be0ad11014713ba199c607a22b4ba51278d64725969b

See more details on using hashes here.

Provenance

The following attestation bundles were made for qmdblack-0.1.0.tar.gz:

Publisher: publish.yml on askblaker/qmdblack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qmdblack-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qmdblack-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qmdblack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f9204036e3183e582a299c4fad4a9b146be9d4efb2b60f4f52a4c438771c818
MD5 1f17464fef22559a8921168685ea0dfc
BLAKE2b-256 5b8992a9ac107a36c455a4ee27ce27147aec5eaa7ec81f51f618c94209e3d116

See more details on using hashes here.

Provenance

The following attestation bundles were made for qmdblack-0.1.0-py3-none-any.whl:

Publisher: publish.yml on askblaker/qmdblack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page