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.1.tar.gz (19.8 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.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qmdblack-0.1.1.tar.gz
  • Upload date:
  • Size: 19.8 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.1.tar.gz
Algorithm Hash digest
SHA256 5aef74a9e23bc7ef0757c2f1c0e553546f733dbd6435c75b07098e1e104f6c5e
MD5 a8e9f056d8b67fb37d98c5cb6bd93e55
BLAKE2b-256 35c2a8282fd17eddff269829c5935e57f81ed2f7977e98977e673e2450c4ee3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for qmdblack-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: qmdblack-0.1.1-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

Hashes for qmdblack-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ad2a0d8717893d75b886a626fdc301b5edf45a3337ca3e603db17204864385a
MD5 fdda568a12976123433160ee37e490f6
BLAKE2b-256 beaea4ec105c5ff04099faeca40cae956bd561287f1a1411a1d5027313a8baa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for qmdblack-0.1.1-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