Requires py-obsidianmd (annoyingly had to figure this out from GH issue as the examples weren’t straightforward). Below is an example of setting many things to publish in Quartz:

from pathlib import Path
from pyomd import Notes, Note
from pyomd.metadata import MetadataType
 
paths = Path("C:\\Users\\Rudhra\\Journal\\content\\Code Diary")
notes = Notes(paths)
notes.metadata.add(k="publish", l="true", meta_type=MetadataType.FRONTMATTER)
notes.update_content(inline_inplace=True, inline_position="top", inline_tml="standard", write=True)

Might need to do this patch: https://github.com/selimrbd/py-obsidianmd/issues/22 (cloning the repo, updating Note to use utf-8, and installing with pip install -e /path/to/clone)