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 Union[str, Path] Path to the input .qmd file. required
linter str Name of the linter that will be used. required
output_path Optional[Union[str, 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 Optional[Path] Path for the output .py file, or None if there was an error.

Examples

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