[ANN] Native Julia engine for quarto using QuartoNotebookRunner.jl

Version 0.13.0 of QuartoNotebookRunner.jl has been release.

The main new feature shipping with this version is the addition of support for running Python cells within our backend. This relies on PythonCall.jl for code evaluation, and so should support anything that that package supports, including importing external Python packages, such as plotting, pandas, etc. All you’ll need to do is add PythonCall to you notebook’s Project.toml and import it into a cell at the start of the notebook, something like:

---
engine: julia
---

```{julia}
import PythonCall
```

```{python}
import seaborn as sns
tips = sns.load_dataset("tips")
sns.relplot(
    data=tips,
    x="total_bill", y="tip", col="time",
    hue="smoker", style="smoker", size="size",
)
```

Ensure you’ve installed the seaborn package before running it. Just use the conda command that PythonCall adds to the Pkg mode.

Julia values can be directly interpolated using $ into Python code blocks, in the same way that we already support interpolation into R code blocks (managed by RCall.jl). This means that (if you really want to) you can use them all together and send R values to Python via Julia.


This is a very new feature addition, so might be buggy in places. Please do open issues if you run into any problems.

Currently quarto won’t have the updated version of QNR installed by default, that’ll take a little time to become available there. In the interim you can use the QUARTO_JULIA_PROJECT environment variable to set the path to a Julia environment that has an up-to-date version of the package.

22 Likes