Wolfram Research

Function Repository Resource:

ImportYAML

Source Notebook

Import a YAML file

Contributed by: Arnoud Buzing

ResourceFunction["ImportYAML"][session,file]

imports a YAML file using an external Python session.

Details and Options

ResourceFunction["ImportYAML"] requires the PyYAML package (pip install PyYAML) on your machine.

Examples

Basic Examples

Install PyYAML, if it is not already available:

In[1]:=
RunProcess[{"pip", "install", "PyYAML"}, "StandardOutput"]
Out[1]=

Import a YAML file:

In[2]:=
session = StartExternalSession["Python"];
ResourceFunction["ImportYAML"][session, "document.yaml"]
Out[2]=

Display the raw content of the file:

Resource History

License Information