convert_qmd_to_py

converter.convert_qmd_to_py(qmd_path, linter, output_path=None, verbose=False)

Convert a Quarto (.qmd) file to Python (.py) file, preserving line alignment.

Parameters

Name Type Description Default
qmd_path str or Path Path to the input .qmd file. required
linter str Name of the linter that will be used. required
output_path str or Path Path for the output .py file. If None, uses qmd_path with .py suffix. None
verbose bool If True, print detailed progress information. False

Returns

Name Type Description
output_path Path Path for the output .py file.

Examples

>>> convert_qmd_to_py("input.qmd", "output.py", True)
# To use from the command line:
# $ python converter.py input.qmd [output.py] [-v]

Notes

Adapted from code generated by Perplexity.