Wolfram Research

Function Repository Resource:

ExportYAML

Source Notebook

Export an expression as a YAML file

Contributed by: Arnoud Buzing

ResourceFunction["ExportYAML"][session,assoc,file]

export assoc to a YAML file using a Python session.

Details and Options

Requires the PyYAML package (pip install PyYAML) on your machine.

Examples

Basic Examples

Start a Python session:

In[1]:=
session = StartExternalSession["Python"];

Export an association as a YAML file:

Print the resulting file for visual inspection:

In[2]:=
FilePrint["C:\\Users\\arnoudb.WRI\\out.yaml"]

Resource History

License Information